ЛР 4: S3-вложения, доступ и отказоустойчивость — на 3

This commit is contained in:
2026-11-20 18:13:30 +03:00
parent ec540a1a72
commit 1e18644624
34 changed files with 1929 additions and 33 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
# Explicit Compose labels scope the socket to this local test project.
case "${LAB4_PROJECT:-}" in
mtusi-lab4-grade3|mtusi-lab4-grade3-*) ;;
*) echo 'LAB4_PROJECT must identify the Lab 4 test stack' >&2; exit 2 ;;
esac
container() {
ids=$(docker ps -aq --filter "label=com.docker.compose.project=$LAB4_PROJECT" \
--filter "label=com.docker.compose.service=$1" \
--filter 'label=com.docker.compose.oneoff=False')
set -- $ids
if [ "$#" -ne 1 ]; then
echo 'Expected one Lab 4 service container' >&2
return 2
fi
printf '%s\n' "$1"
}