Skip to content

Commit

Permalink
Merge branch 'develop' into Smithh-Co-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson authored Nov 2, 2023
2 parents de31825 + a886f70 commit de5e3d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/deploy-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}"
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion tdrs-backend/tdpservice/settings/cloudgov.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit de5e3d5

Please sign in to comment.