From 352660421bc0d2ecb1219ecaaeee334f80d4a424 Mon Sep 17 00:00:00 2001 From: George Hudson Date: Wed, 11 Oct 2023 13:09:52 -0600 Subject: [PATCH] moving setting vars for clamav server to above cf push --- scripts/deploy-backend.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/deploy-backend.sh b/scripts/deploy-backend.sh index 3b06c9d94..f50152891 100755 --- a/scripts/deploy-backend.sh +++ b/scripts/deploy-backend.sh @@ -83,6 +83,15 @@ generate_jwt_cert() update_backend() { cd tdrs-backend || exit + cf unset-env "$CGAPPNAME_BACKEND" "AV_SCAN_URL" + + if ["$CF_SPACE" = "tanf-prod" ]; then + cf set-env "$CGAPPNAME_BACKEND" AV_SCAN_URL "http://tanf-prod-clamav-rest.apps.internal:9000/scan" + else + # Add environment varilables for clamav + cf set-env "$CGAPPNAME_BACKEND" AV_SCAN_URL "http://tdp-clamav-nginx-$env.apps.internal:9000/scan" + fi + if [ "$1" = "rolling" ] ; then set_cf_envs @@ -100,21 +109,17 @@ update_backend() fi set_cf_envs - + cf map-route "$CGAPPNAME_BACKEND" apps.internal --hostname "$CGAPPNAME_BACKEND" # Add network policy to allow frontend to access backend cf add-network-policy "$CGAPPNAME_FRONTEND" "$CGAPPNAME_BACKEND" --protocol tcp --port 8080 - cf unset-env "$CGAPPNAME_BACKEND" "AV_SCAN_URL" + if ["$CF_SPACE" = "tanf-prod" ]; then # Add network policy to allow backend to access tanf-prod services cf add-network-policy "$CGAPPNAME_BACKEND" clamav-rest --protocol tcp --port 9000 - cf set-env "$CGAPPNAME_BACKEND" AV_SCAN_URL "http://tanf-prod-clamav-rest.apps.internal:9000/scan" else cf add-network-policy "$CGAPPNAME_BACKEND" tdp-clamav-nginx-$env --protocol tcp --port 9000 - - # Add environment varilables for clamav - cf set-env "$CGAPPNAME_BACKEND" AV_SCAN_URL "http://tdp-clamav-nginx-$env.apps.internal:9000/scan" fi cd ..