From 849346962389df3c1d90117ee439139fa7c7d39a Mon Sep 17 00:00:00 2001 From: Simon K <6615834+simon-20@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:03:23 +0100 Subject: [PATCH] fix: add missing ENV var from GH deploy workflow * Add missing env var from Github workflow * Alter Github variables config template to handle 'prod' domain --- .github/workflows/build-and-deploy-job.yml | 1 + .../add-default-config-to-github-variables.sh | 11 +++++++++++ azure-provision/default-github-config-template.env | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy-job.yml b/.github/workflows/build-and-deploy-job.yml index cec52bd..f053319 100644 --- a/.github/workflows/build-and-deploy-job.yml +++ b/.github/workflows/build-and-deploy-job.yml @@ -105,6 +105,7 @@ jobs: DATA_REGISTRY_BASE_URL: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'DATA_REGISTRY_BASE_URL')] }} DATA_REGISTRY_PUBLISHER_METADATA_URL: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'DATA_REGISTRY_PUBLISHER_METADATA_URL')] }} DATA_REGISTRY_PUBLISHER_METADATA_REFRESH_AFTER_HOURS: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'DATA_REGISTRY_PUBLISHER_METADATA_REFRESH_AFTER_HOURS')] }} + WEB_BASE_URL: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'WEB_BASE_URL')] }} NUMBER_DOWNLOADER_THREADS: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'NUMBER_DOWNLOADER_THREADS')] }} FORCE_REDOWNLOAD_AFTER_HOURS: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'FORCE_REDOWNLOAD_AFTER_HOURS')] }} REMOVE_LAST_GOOD_DOWNLOAD_AFTER_FAILING_HOURS: ${{ vars[format('{0}_{1}', env.TARGET_ENVIRONMENT_UPPER, 'REMOVE_LAST_GOOD_DOWNLOAD_AFTER_FAILING_HOURS')] }} diff --git a/azure-provision/add-default-config-to-github-variables.sh b/azure-provision/add-default-config-to-github-variables.sh index 404c11a..f59218b 100755 --- a/azure-provision/add-default-config-to-github-variables.sh +++ b/azure-provision/add-default-config-to-github-variables.sh @@ -29,9 +29,20 @@ fi TARGET_ENVIRONMENT="$1" +WEB_BASE_URL_PREFIX=$([[ "$TARGET_ENVIRONMENT" == "prod" ]] && echo "" || echo "${TARGET_ENVIRONMENT}-") + +SUBDOMAIN="${WEB_BASE_URL_PREFIX}bulk-data" + +CUSTOM_DOMAIN="${SUBDOMAIN}.iatistandard.org" + +WEB_BASE_URL="https://${CUSTOM_DOMAIN}" + +echo $WEB_BASE_URL + cp -f azure-provision/default-github-config-template.env azure-provision/default-github-config.env sed -i "s/^/${TARGET_ENVIRONMENT^^}/g" azure-provision/default-github-config.env sed -i "s/{{TARGET_ENVIRONMENT}}/${TARGET_ENVIRONMENT}/g" azure-provision/default-github-config.env +sed -i "s#{{WEB_BASE_URL}}#${WEB_BASE_URL}#g" azure-provision/default-github-config.env gh variable set --env-file ./azure-provision/default-github-config.env diff --git a/azure-provision/default-github-config-template.env b/azure-provision/default-github-config-template.env index 481da52..5819eb1 100644 --- a/azure-provision/default-github-config-template.env +++ b/azure-provision/default-github-config-template.env @@ -8,5 +8,5 @@ _FORCE_REDOWNLOAD_AFTER_HOURS=24 _NUMBER_DOWNLOADER_THREADS=25 _REMOVE_LAST_GOOD_DOWNLOAD_AFTER_FAILING_HOURS=72 _ZIP_WORKING_DIR=/tmp/bulk-data-service-zip -_WEB_BASE_URL="https://{{TARGET_ENVIRONMENT}}-bulk-data.iatistandard.org" +_WEB_BASE_URL="{{WEB_BASE_URL}}" _CHECKER_LOOP_WAIT_MINS=20