chore: port lab5 solution as lab6 base

This commit is contained in:
2026-11-18 18:40:47 +03:00
parent 470d9d6f1e
commit 98d5787545
105 changed files with 21898 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
project="${COMPOSE_PROJECT_NAME:-messenger-lab6}"
labels=$(docker inspect -f '{{index .Config.Labels "com.docker.compose.project"}}/{{index .Config.Labels "com.docker.compose.service"}}' "$TARGET_INSTANCE_ID")
if [ "$labels" != "$project/api" ]; then
echo "refusing to stop $TARGET_INSTANCE_ID: not an api replica of $project ($labels)" >&2
exit 1
fi
docker stop -t 8 "$TARGET_INSTANCE_ID" >/dev/null
docker inspect -f '{{.Name}} {{.State.Status}} finished={{.State.FinishedAt}}' "$TARGET_INSTANCE_ID"