Use new variable ENVIRONMENT in /etc/bridgehead; defaults to "production".

This commit is contained in:
Martin Lablans 2024-01-08 13:03:12 +01:00
parent 954d46efb1
commit 2074461ee7
2 changed files with 19 additions and 8 deletions

View File

@ -4,14 +4,22 @@ if [ "${ENABLE_ERIC}" == "true" ]; then
log INFO "BBMRI-ERIC setup detected -- will start services for BBMRI-ERIC."
OVERRIDE+=" -f ./$PROJECT/modules/eric-compose.yml"
# Set required variables
ERIC_BROKER_ID=broker.bbmri.samply.de
ERIC_ROOT_CERT=eric
if [ "{$ENABLE_TEST}" == "true" ]; then
ERIC_BROKER_ID=broker-test.bbmri-test.samply.de
ERIC_ROOT_CERT=eric.test
fi
# The environment needs to be defined in /etc/bridgehead
case "$ENVIRONMENT" in
"production")
ERIC_BROKER_ID=broker.bbmri.samply.de
ERIC_ROOT_CERT=eric
;;
"test")
ERIC_BROKER_ID=broker-test.bbmri-test.samply.de
ERIC_ROOT_CERT=eric.test
;;
*)
report_error 6 "Environment \"$ENVIRONMENT\" is unknown. Assuming production. FIX THIS!"
ERIC_BROKER_ID=broker.bbmri.samply.de
ERIC_ROOT_CERT=eric
;;
esac
ERIC_BROKER_URL=https://${ERIC_BROKER_ID}
ERIC_PROXY_ID=${SITE_ID}.${ERIC_BROKER_ID}

View File

@ -66,6 +66,9 @@ loadVars() {
detectCompose
setHostname
setupProxy
# Set some project-independent default values
: ${ENVIRONMENT:=production}
}
case "$ACTION" in