:-'Generic Commit'
Some checks failed
Build-Test-Publish / Build (push) Failing after 25s

This commit is contained in:
Your Name
2025-05-30 20:32:01 +12:00
parent d741bc5efc
commit 77a800293f
2 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
services:
sos:
image: gitea.jde.nz/public/simple-object-storage:test
container_name: sos-test
ports:
- 7703:80
volumes:
@@ -9,7 +10,7 @@ services:
- SOS_CONFIG=/data/sos_config.json
restart: no
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7703/status"]
test: ["CMD", "wget", "-qO-", "http://0.0.0.0/status"]
interval: 1s
timeout: 1s
retries: 3

View File

@@ -15,6 +15,28 @@ function title() {
echo "----------------------------------------"
}
function wait_for_container {
container_id="$1"
container_name="$(docker inspect "${container_id}" --format '{{ .Name }}')"
echo "Waiting for container: ${container_name} [${container_id}]"
waiting_done="false"
while [[ "${waiting_done}" != "true" ]]; do
container_state="$(docker inspect "${container_id}" --format '{{ .State.Status }}')"
if [[ "${container_state}" == "running" ]]; then
health_status="$(docker inspect "${container_id}" --format '{{ .State.Health.Status }}')"
echo "${container_name}: container_state=${container_state}, health_status=${health_status}"
if [[ ${health_status} == "healthy" ]]; then
waiting_done="true"
fi
else
echo "${container_name}: container_state=${container_state}"
waiting_done="true"
fi
sleep 1;
done;
}
#------------------------------------------------------------------------------------------------
# build the executable
title "Building amd64 executable"
@@ -54,6 +76,8 @@ docker compose -f "${COMPOSE_FILE}" rm -v
docker compose -f "${COMPOSE_FILE}" up -d
# wait until healthy.
wait_for_container "sos-test"
"${SCRIPT_DIR}/test.sh" "http://localhost:7703"
RESULT=$?