@@ -5,33 +5,44 @@ set -eoxf pipefail
55s3Accesskey=drycc
66s3Secretkey=123456789
77
8- STORAGE_JOB=$( podman run -d --name storage \
8+ STORAGE_JOB=$( podman run -d --entrypoint init-stack -p 8333:8333 \
99 -e DRYCC_STORAGE_ACCESSKEY=$s3Accesskey \
1010 -e DRYCC_STORAGE_SECRETKEY=$s3Secretkey \
11- " ${DEV_REGISTRY} " /drycc/storage:canary minio server /data/storage/ --console-address :9001)
12-
13- sleep 5
14- podman logs " ${STORAGE_JOB} "
11+ " ${DEV_REGISTRY} " /drycc/storage:canary weed server -dir=/data/hdd -s3)
1512
13+ # wait for port
1614STORAGE_IP=$( podman inspect --format " {{ .NetworkSettings.IPAddress }}" " ${STORAGE_JOB} " )
15+ echo -e " \\ 033[32m---> Waitting for ${STORAGE_IP} :8333\\ 033[0m"
16+ wait-for-port --host=" ${STORAGE_IP} " 8333
17+ echo -e " \\ 033[32m---> S3 service ${STORAGE_IP} :8333 ready...\\ 033[0m"
18+ podman logs " ${STORAGE_JOB} "
1719
18- JOB=$( podman run --add-host storage:" ${STORAGE_IP} " \
19- -d \
20- -p 5000:5000 \
20+ JOB=$( podman run -d -p 5000:5000 \
2121 -e REGISTRY_HTTP_SECRET=drycc \
2222 -e DRYCC_REGISTRY_REDIRECT=false \
2323 -e DRYCC_REGISTRY_USERNAME=admin \
2424 -e DRYCC_REGISTRY_PASSWORD=admin \
2525 -e DRYCC_STORAGE_LOOKUP=path \
2626 -e DRYCC_STORAGE_BUCKET=registry \
27- -e DRYCC_STORAGE_ENDPOINT=http://storage:9000 \
27+ -e DRYCC_STORAGE_ENDPOINT=" http://${STORAGE_IP} :8333 " \
2828 -e DRYCC_STORAGE_ACCESSKEY=$s3Accesskey \
2929 -e DRYCC_STORAGE_SECRETKEY=$s3Secretkey \
3030 " $1 " )
3131
32+ # shellcheck disable=SC2317
33+ function clean_before_exit {
34+ # delay before exiting, so stdout/stderr flushes through the logging system
35+ podman kill " ${JOB} "
36+ podman kill " ${STORAGE_JOB} "
37+ podman rm " ${JOB} " " ${STORAGE_JOB} "
38+ }
39+ trap clean_before_exit EXIT
40+
3241# let the registry run for a few seconds
33- sleep 5
42+ REGISTRY_IP=$( podman inspect --format " {{ .NetworkSettings.IPAddress }}" " ${JOB} " )
43+ echo -e " \\ 033[32m---> Waitting for ${REGISTRY_IP} :5000\\ 033[0m"
44+ wait-for-port --host=" ${REGISTRY_IP} " 5000
45+ echo -e " \\ 033[32m---> S3 service ${REGISTRY_IP} :5000 ready...\\ 033[0m"
3446# check that the registry is still up
3547podman logs " ${JOB} "
3648podman ps -q --no-trunc=true | grep " ${JOB} "
37- podman rm -f " ${JOB} " " ${STORAGE_JOB} "
0 commit comments