Skip to content

Commit

Permalink
Update cloudgov.py (#2730)
Browse files Browse the repository at this point in the history
* Update cloudgov.py

* hijack develop workflow to test deployments.

* syntax typo.

* I can't believe this typo.

* linting whitespace

* removed extra space

* Adding in staging jwt_key due to recent deployment failure.

* Removing self-reference branch filter for mergability

---------

Co-authored-by: andrew-jameson <[email protected]>
Co-authored-by: George Hudson <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2023
1 parent 932a41e commit a886f70
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 a886f70

Please sign in to comment.