From 9e2c43748bac90c7043693905c0b3d2f5f68009e Mon Sep 17 00:00:00 2001 From: George Hudson Date: Fri, 29 Sep 2023 09:46:18 -0600 Subject: [PATCH] updated for using backend to set ENV for ClamAV URL. --- .circleci/deployment/commands.yml | 10 +--------- scripts/deploy-backend.sh | 4 ++++ tdrs-backend/manifest.yml | 2 -- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.circleci/deployment/commands.yml b/.circleci/deployment/commands.yml index 5240a4f03..43adb60e3 100644 --- a/.circleci/deployment/commands.yml +++ b/.circleci/deployment/commands.yml @@ -100,15 +100,7 @@ name: Deploy ClamAV REST application command: | cf push clamav-rest -f tdrs-backend/manifest.clamav.yml \ - --var cf-space=tanf-prod \ - - run: - name: Enable internal route between backend and clamav-rest app - command: | - cf add-network-policy tdp-backend-prod clamav-rest \ - -s tanf-prod \ - -o hhs-acf-ofa \ - --protocol tcp \ - --port 9000 + --var cf-space=tanf-prod deploy-frontend: parameters: diff --git a/scripts/deploy-backend.sh b/scripts/deploy-backend.sh index bc1b88545..4ef378ec6 100755 --- a/scripts/deploy-backend.sh +++ b/scripts/deploy-backend.sh @@ -110,8 +110,12 @@ update_backend() 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 "https://tdp-clamav-nginx-$env.apps.internal:9000/scan" fi cd .. diff --git a/tdrs-backend/manifest.yml b/tdrs-backend/manifest.yml index 473c6d387..ff11600da 100755 --- a/tdrs-backend/manifest.yml +++ b/tdrs-backend/manifest.yml @@ -6,6 +6,4 @@ applications: disk_quota: 2G docker: image: ((docker-backend)) - env: - AV_SCAN_URL: http://((cf-space))-clamav-rest.apps.internal:9000/scan \ No newline at end of file