34 lines
985 B
Bash
34 lines
985 B
Bash
#!/usr/bin/env bash
|
|
set -u -o pipefail
|
|
|
|
TEST_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
test_dir="$(mktemp -d)"
|
|
trap 'rm -rf "$test_dir"' EXIT
|
|
|
|
source "${TEST_ROOT}/inc/runtime-config.inc"
|
|
|
|
unset TAPM_BROKER_URL GITEA_DOMAIN GITEA_URL
|
|
if ! TAPM_ENSURE_RUNTIME_CONFIG >/dev/null; then
|
|
printf 'FAIL: built-in configuration was rejected\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$TAPM_BROKER_URL" != 'https://tapm.technologyarch.com' ||
|
|
"$GITEA_DOMAIN" != 'tagit.technologyarch.com' ||
|
|
"$GITEA_URL" != 'https://tagit.technologyarch.com' ]]; then
|
|
printf 'FAIL: built-in configuration did not load\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
TAPM_BROKER_URL='https://tapm.test.example'
|
|
GITEA_DOMAIN='git.test.example'
|
|
TAPM_LOAD_RUNTIME_CONFIG
|
|
if [[ "$TAPM_BROKER_URL" != 'https://tapm.test.example' ||
|
|
"$GITEA_DOMAIN" != 'git.test.example' ||
|
|
"$GITEA_URL" != 'https://git.test.example' ]]; then
|
|
printf 'FAIL: environment overrides did not load\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
printf 'PASS: built-in runtime configuration\n'
|