diff --git a/scripts/deploy-backend.sh b/scripts/deploy-backend.sh index f50152891..7fb1fb657 100755 --- a/scripts/deploy-backend.sh +++ b/scripts/deploy-backend.sh @@ -51,6 +51,8 @@ set_cf_envs() "FRONTEND_BASE_URL" "LOGGING_LEVEL" "REDIS_URI" + "JWT_KEY" + "STAGING_JWT_KEY" ) echo "Setting environment variables for $CGAPPNAME_BACKEND" @@ -62,6 +64,8 @@ set_cf_envs() cf_cmd="cf unset-env $CGAPPNAME_BACKEND $var_name ${!var_name}" $cf_cmd continue + elif [[ ("$var_name" =~ "STAGING_*") && ("$CF_SPACE" = "tanf-staging") ]]; then + var_name=$(echo "$var_name" | sed -e 's@STAGING_@@g') fi cf_cmd="cf set-env $CGAPPNAME_BACKEND $var_name ${!var_name}" @@ -128,7 +132,7 @@ update_backend() bind_backend_to_services() { echo "Binding services to app: $CGAPPNAME_BACKEND" - if [ "$CFAPPNAME_BACKEND" = "tdp-backend-develop" ]; then + if [ "$CGAPPNAME_BACKEND" = "tdp-backend-develop" ]; then # TODO: this is technical debt, we should either make staging mimic tanf-dev # or make unique services for all apps but we have a services limit # Introducing technical debt for release 3.0.0 specifically. diff --git a/tdrs-backend/tdpservice/settings/cloudgov.py b/tdrs-backend/tdpservice/settings/cloudgov.py index 6f7c7342b..b7def9383 100644 --- a/tdrs-backend/tdpservice/settings/cloudgov.py +++ b/tdrs-backend/tdpservice/settings/cloudgov.py @@ -70,7 +70,11 @@ class CloudGov(Common): # env_based_db_name = f'tdp_db_{cloudgov_space_suffix}_{cloudgov_name}' - db_name = database_creds['db_name'] if (cloudgov_space_suffix in ["prod", "staging"]) else env_based_db_name + logger.debug("css: " + cloudgov_space_suffix) + if (cloudgov_space_suffix in ["prod", "staging"]): + db_name = database_creds['db_name'] + else: + db_name = env_based_db_name DATABASES = { 'default': {