This commit is contained in:
@@ -88,7 +88,26 @@ jobs:
|
|||||||
docker rm -f devops-platform || true
|
docker rm -f devops-platform || true
|
||||||
if ! IMAGE="$OLD_IMAGE" docker compose up -d --no-build app; then
|
if ! IMAGE="$OLD_IMAGE" docker compose up -d --no-build app; then
|
||||||
echo "ERROR: rollback failed; manual recovery required"
|
echo "ERROR: rollback failed; manual recovery required"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ROLLBACK_HEALTHY=false
|
||||||
|
|
||||||
|
for attempt in $(seq 1 15); do
|
||||||
|
if docker exec devops-platform python -c \
|
||||||
|
"import urllib.request; r=urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2); assert r.status == 200"; then
|
||||||
|
ROLLBACK_HEALTHY=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$ROLLBACK_HEALTHY" = true ]; then
|
||||||
|
echo "Rollback successful; previous version is healthy"
|
||||||
|
else
|
||||||
|
echo "ERROR: rollback container failed health check; manual recovery required"
|
||||||
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user