#!/bin/sh set -eu cd "$(dirname "$0")/.." replica=$(docker compose ps -q api | xargs docker inspect -f '{{.Name}} {{.Config.Hostname}}' | awk '$1=="/highload-lab7-api-2" {print $2}') test -n "$replica" trap 'docker compose start api >/dev/null' EXIT TARGET_INSTANCE_ID="$replica" ./scripts/stop-one.sh ./scripts/wait_ingress.sh make test CA_FILE=secrets/tls/lab7-ca.crt