This commit is contained in:
@@ -6,6 +6,7 @@ ENV_FILE="${ENV_FILE:-/home/m/assistant-deploy/production-compose.env}"
|
|||||||
COMPOSE_FILE="$BASE_DIR/deploy/docker-compose.prod.yml"
|
COMPOSE_FILE="$BASE_DIR/deploy/docker-compose.prod.yml"
|
||||||
SUPERVISOR_CONTROL_URL="${SUPERVISOR_CONTROL_URL:-http://127.0.0.1:${SUPERVISOR_CONTROL_PORT:-18085}}"
|
SUPERVISOR_CONTROL_URL="${SUPERVISOR_CONTROL_URL:-http://127.0.0.1:${SUPERVISOR_CONTROL_PORT:-18085}}"
|
||||||
REVISION="${1:?candidate revision is required}"
|
REVISION="${1:?candidate revision is required}"
|
||||||
|
HEALTH_ATTEMPTS="${HEALTH_ATTEMPTS:-360}"
|
||||||
|
|
||||||
set -a
|
set -a
|
||||||
. "$ENV_FILE"
|
. "$ENV_FILE"
|
||||||
@@ -51,7 +52,7 @@ compose --profile assistant-canary build --build-arg "SOURCE_REVISION=$REVISION"
|
|||||||
wait_healthy() {
|
wait_healthy() {
|
||||||
local container="$1" status="" ready=""
|
local container="$1" status="" ready=""
|
||||||
ready=""
|
ready=""
|
||||||
for attempt in $(seq 1 60); do
|
for attempt in $(seq 1 "$HEALTH_ATTEMPTS"); do
|
||||||
status=$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}unknown{{end}}' "$container" 2>/dev/null || true)
|
status=$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}unknown{{end}}' "$container" 2>/dev/null || true)
|
||||||
if [[ "$status" == healthy ]]; then ready=true; break; fi
|
if [[ "$status" == healthy ]]; then ready=true; break; fi
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|||||||
@@ -14,4 +14,6 @@ grep -Fq 'assert_stable_ids_unchanged' "$canary"
|
|||||||
grep -Fq 'before=$(stable_ids)' "$supervisor"
|
grep -Fq 'before=$(stable_ids)' "$supervisor"
|
||||||
grep -Fq 'after=$(stable_ids)' "$supervisor"
|
grep -Fq 'after=$(stable_ids)' "$supervisor"
|
||||||
grep -Fq 'stable container IDs changed' "$supervisor"
|
grep -Fq 'stable container IDs changed' "$supervisor"
|
||||||
|
grep -Fq 'HEALTH_ATTEMPTS="${HEALTH_ATTEMPTS:-360}"' "$canary"
|
||||||
|
grep -Fq 'seq 1 "$HEALTH_ATTEMPTS"' "$canary"
|
||||||
echo 'stable release-set guard: PASS'
|
echo 'stable release-set guard: PASS'
|
||||||
|
|||||||
Reference in New Issue
Block a user