ananke/scripts/verify_install_templates.sh

41 lines
852 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${REPO_DIR}"
check_template() {
local template="$1"
shift
local found=""
local candidate
for candidate in "$@"; do
if [[ -f "${candidate}" ]]; then
found="${candidate}"
break
fi
done
if [[ -z "${found}" ]]; then
echo "[template-contract] ${template}: no candidate exists: $*" >&2
return 1
fi
echo "[template-contract] ${template}: ${found}"
return 0
}
check_template coordinator \
"configs/ananke.coordinator.yaml" \
"configs/ananke.titan-db.yaml" \
"configs/hecate.titan-db.yaml"
check_template peer \
"configs/ananke.peer.yaml" \
"configs/ananke.tethys.yaml" \
"configs/hecate.tethys.yaml"
check_template example \
"configs/ananke.example.yaml" \
"configs/hecate.example.yaml"