diff --git a/scripts/deploy-backend.sh b/scripts/deploy-backend.sh index 3cf5f1030..c4ab36e2b 100755 --- a/scripts/deploy-backend.sh +++ b/scripts/deploy-backend.sh @@ -58,7 +58,6 @@ set_cf_envs() "LOGGING_LEVEL" "REDIS_URI" "JWT_KEY" - "STAGING_JWT_KEY" "SENDGRID_API_KEY" ) @@ -71,9 +70,13 @@ 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 - sed_var_name=$(echo "$var_name" | sed -e 's@STAGING_@@g') - cf_cmd="cf set-env $CGAPPNAME_BACKEND $sed_var_name ${!var_name}" + elif [[ ("$CF_SPACE" = "tanf-staging") ]]; then + var_value=${!var_name} + staging_var="STAGING_$var_name" + if [[ "${!staging_var}" ]]; then + var_value=${!staging_var} + fi + cf_cmd="cf set-env $CGAPPNAME_BACKEND $var_name ${var_value}" else cf_cmd="cf set-env $CGAPPNAME_BACKEND $var_name ${!var_name}" fi diff --git a/tdrs-backend/Dockerfile b/tdrs-backend/Dockerfile index 606b86b79..34ef5dd9b 100644 --- a/tdrs-backend/Dockerfile +++ b/tdrs-backend/Dockerfile @@ -21,9 +21,9 @@ RUN apt-get install -y gcc graphviz graphviz-dev libpq-dev python3-dev vim curl # Postgres client setup #RUN bash -c 'echo "deb [trusted=yes] https://tdp-nexus.dev.raftlabs.tech/repository/apt-proxy-postgres/ bullseye-pdpg main" >> /etc/apt/sources.list' RUN apt-get update -y && apt-get upgrade -y -RUN apt install -y postgresql-common && install -d /usr/share/postgresql-common/pgdg && \ -sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc trusted=yes] https://tdp-nexus.dev.raftlabs.tech/repository/apt-proxy-postgres/ bullseye-pgdg main" >> /etc/apt/sources.list' && \ +RUN apt --purge remove postgresql postgresql-* && apt install -y postgresql-common curl ca-certificates && install -d /usr/share/postgresql-common/pgdg && \ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \ +sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ apt -y update && apt -y upgrade && apt install postgresql-client-15 -y # Install pipenv diff --git a/tdrs-frontend/cypress/e2e/common-steps/common-steps.js b/tdrs-frontend/cypress/e2e/common-steps/common-steps.js index e6a735c33..fcc2e74f2 100644 --- a/tdrs-frontend/cypress/e2e/common-steps/common-steps.js +++ b/tdrs-frontend/cypress/e2e/common-steps/common-steps.js @@ -1,12 +1,15 @@ import { When } from '@badeball/cypress-cucumber-preprocessor' When('{string} visits the home page', (username) => { + cy.clearCookie('sessionid') + cy.clearCookie('csrftoken') cy.intercept('/v1/stts/alpha').as('getSttSearchList') cy.visit('/') cy.contains('Sign into TANF Data Portal', { timeout: 30000 }) }) When('The admin logs in', () => { + cy.visit('/') cy.adminLogin('cypress-admin@teamraft.com') }) @@ -14,25 +17,28 @@ When('{string} logs in', (username) => { cy.login(username) }) -When('The admin sets the approval status of {string} to {string}', (username, status) => { - cy.get('@cypressUser').then((cypressUser) => { - let body = { - username: username, - first_name: '', - last_name: '', - email: username, - stt: '6', - groups: '2', - account_approval_status: status, - access_requested_date_0: '0001-01-01', - access_requested_date_1: '00:00:00', - _save: 'Save', - } +When( + 'The admin sets the approval status of {string} to {string}', + (username, status) => { + cy.get('@cypressUser').then((cypressUser) => { + let body = { + username: username, + first_name: '', + last_name: '', + email: username, + stt: '6', + groups: '2', + account_approval_status: status, + access_requested_date_0: '0001-01-01', + access_requested_date_1: '00:00:00', + _save: 'Save', + } - cy.adminApiRequest( - 'POST', - `/users/user/${cypressUser.selector.id}/change/`, - body - ) - }) -}) + cy.adminApiRequest( + 'POST', + `/users/user/${cypressUser.selector.id}/change/`, + body + ) + }) + } +)