forked from mtusi2026/mtusi2026lab4
ЛР4: обновить отчёт и доказательства для ревизии 02fc97b
This commit is contained in:
@@ -31,6 +31,12 @@ cleanup() {
|
||||
if [ -d "$tmp" ]; then
|
||||
(cd "$tmp" && COMPOSE_PROJECT_NAME=$project LB_PORT=$port \
|
||||
./scripts/compose.sh --env-file .env down -v --remove-orphans >/dev/null 2>&1 || true)
|
||||
ids=$(docker ps -aq --filter label=com.docker.compose.project=$project || true)
|
||||
if [ -n "$ids" ]; then docker rm -f $ids >/dev/null 2>&1 || true; fi
|
||||
volumes=$(docker volume ls -q --filter label=com.docker.compose.project=$project || true)
|
||||
if [ -n "$volumes" ]; then docker volume rm $volumes >/dev/null 2>&1 || true; fi
|
||||
networks=$(docker network ls -q --filter label=com.docker.compose.project=$project || true)
|
||||
if [ -n "$networks" ]; then docker network rm $networks >/dev/null 2>&1 || true; fi
|
||||
docker image rm -f "$image" >/dev/null 2>&1 || true
|
||||
case "$tmp" in
|
||||
"$artifact_root"/clean-clone.*) rm -rf "$tmp" ;;
|
||||
@@ -58,13 +64,15 @@ test "$(git rev-parse HEAD)" = "$revision"
|
||||
|
||||
echo "== local configuration with fresh synthetic credentials =="
|
||||
./scripts/init-env.sh
|
||||
python3 - "$tmp/.env" "$port" <<'PY'
|
||||
python3 - "$tmp/.env" "$port" "$project" <<'PY'
|
||||
import sys
|
||||
path, port = sys.argv[1], sys.argv[2]
|
||||
path, port, project = sys.argv[1], sys.argv[2], sys.argv[3]
|
||||
lines = []
|
||||
for line in open(path):
|
||||
if line.startswith('LB_PORT='):
|
||||
line = 'LB_PORT=%s\n' % port
|
||||
elif line.startswith('COMPOSE_PROJECT_NAME='):
|
||||
line = 'COMPOSE_PROJECT_NAME=%s\n' % project
|
||||
lines.append(line)
|
||||
open(path, 'w').writelines(lines)
|
||||
PY
|
||||
|
||||
Reference in New Issue
Block a user