This commit is contained in:
@@ -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=$?
|
||||
|
Reference in New Issue
Block a user