chore: substitute env vars in qt/ files during deploy time (#72)

substitute env vars in qt/ files during deploy time
Reviewed-on: #72
This commit was merged in pull request #72.
This commit is contained in:
2026-08-26 11:00:41 +02:00
parent 0e6dfe5e97
commit 1289fa05a1
2 changed files with 24 additions and 10 deletions
+18 -10
View File
@@ -5,6 +5,23 @@
# Overridable so the scripts can be exercised outside of the runner
HLA_ROOT=${HLA_ROOT:-/sls/bd/hla}
# Sets AGEBD_ENV_SUFFIX_UPPER/LOWER for the given environment.
# Usage: set_env_suffix <dev|prod>
set_env_suffix() {
local ENV=$1
if [ "${ENV}" = "dev" ]; then
AGEBD_ENV_SUFFIX_UPPER="-DEV"
AGEBD_ENV_SUFFIX_LOWER="-dev"
elif [ "${ENV}" = "prod" ]; then
AGEBD_ENV_SUFFIX_UPPER=""
AGEBD_ENV_SUFFIX_LOWER=""
else
echo "Unknown environment '${ENV}', expected 'dev' or 'prod'" >&2
exit 1
fi
}
# Sets the naming and path variables used by the deploy and ioc scripts.
# Usage: init_service_env <service-name> <dev|prod>
init_service_env() {
@@ -16,16 +33,7 @@ init_service_env() {
exit 1
fi
if [ "${AGEBD_ENV}" = "dev" ]; then
AGEBD_ENV_SUFFIX_UPPER="-DEV"
AGEBD_ENV_SUFFIX_LOWER="-dev"
elif [ "${AGEBD_ENV}" = "prod" ]; then
AGEBD_ENV_SUFFIX_UPPER=""
AGEBD_ENV_SUFFIX_LOWER=""
else
echo "Unknown environment '${AGEBD_ENV}', expected 'dev' or 'prod'" >&2
exit 1
fi
set_env_suffix "${AGEBD_ENV}"
SERVICE_NAME_LOWER=$(echo "${SERVICE_NAME}" | tr '[:upper:]' '[:lower:]')
SERVICE_NAME_UPPER=$(echo "${SERVICE_NAME}" | tr '[:lower:]' '[:upper:]')
+6
View File
@@ -116,6 +116,12 @@ jobs:
--exclude='.pytest_cache/' \
./qt/* "${DEST_DIR}/"
### SUBSTITUTIONS
source "${{ github.workspace }}/.gitea/scripts/common.sh"
set_env_suffix "${AGEBD_ENV}"
sed -i "s/{{ *agebd_env_suffix_upper* }}/${AGEBD_ENV_SUFFIX_UPPER}/g" "${DEST_DIR}/"*
sed -i "s/{{ *agebd_env_suffix_lower* }}/${AGEBD_ENV_SUFFIX_LOWER}/g" "${DEST_DIR}/"*
# -----------------------------------------------------------------
# Services Detection, Testing, and Deployment
# -----------------------------------------------------------------