who_need_help/scripts/edge-up.sh
SimpleTest a7412c65b5
Some checks are pending
Quality / full-local-gates (push) Waiting to run
Keep shared edge deployment isolated
2026-07-21 18:18:43 +03:00

31 lines
721 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
env_file=${1:-"$ROOT/.env"}
if [[ "$env_file" != /* ]]; then
env_file="$ROOT/$env_file"
fi
if [[ ! -f "$env_file" ]]; then
echo "Edge environment does not exist: $env_file" >&2
exit 1
fi
"$ROOT/scripts/validate-edge-env.sh" "$env_file"
edge_compose_project_name=$(awk '
index($0, "EDGE_COMPOSE_PROJECT_NAME=") == 1 {
print substr($0, length("EDGE_COMPOSE_PROJECT_NAME=") + 1)
exit
}
' "$env_file")
exec docker compose \
--project-name "$edge_compose_project_name" \
--project-directory "$ROOT" \
--env-file "$env_file" \
--file "$ROOT/compose.edge.yaml" \
up -d --build --wait --remove-orphans