feat(lab5): implement reliable image pipeline and track 2
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID required}"
|
||||
for container in $(./scripts/compose.sh ps -q api); do
|
||||
instance=$(docker exec "$container" python -c 'import urllib.request; print(urllib.request.urlopen("http://127.0.0.1:8080/health/live").headers["X-Instance-Id"])')
|
||||
if [ "$instance" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker stop -t 2 "$container" >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
Reference in New Issue
Block a user