18 lines
1004 B
Bash
18 lines
1004 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# Invoked ONLY by an approved CI job on the target host; never by application startup.
|
|
[[ "${CI:-}" == true && "${RUNTIME_READ_APPROVED_SHA:-}" =~ ^[0-9a-f]{40}$ ]] || exit 64
|
|
root=$(git rev-parse --show-toplevel)
|
|
[[ "$(git rev-parse HEAD)" == "$RUNTIME_READ_APPROVED_SHA" ]] || exit 65
|
|
[[ -z "$(git status --porcelain)" ]] || exit 65
|
|
[[ "${RUNTIME_SNAPSHOT_REVIEWED:-}" == true ]] || exit 66
|
|
# Gateway remains untouched. Its original writable data volume is NEVER mounted.
|
|
# The external snapshot must already exist; do not silently initialize empty data.
|
|
docker volume inspect canina_hermes_inventory_snapshot >/dev/null
|
|
docker network inspect canina_hermes_backend >/dev/null
|
|
for name in hermes_username hermes_password hermes_signing_key; do
|
|
test -s "/opt/services/canina/secrets/$name"
|
|
done
|
|
docker compose -f "$root/infra/hermes-runtime/compose.readonly.yml" config --quiet
|
|
docker compose -f "$root/infra/hermes-runtime/compose.readonly.yml" up -d --no-build
|