diff --git a/.github/workflows/fix-network-policy.yml b/.github/workflows/fix-network-policy.yml deleted file mode 100644 index 3d99192d5..000000000 --- a/.github/workflows/fix-network-policy.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Fix Network policies -on: - workflow_dispatch: - inputs: - environment: - description: Environment to fix - required: true - default: Development - type: environment - -jobs: - cf: - name: Cloud Foundry Network - runs-on: ubuntu-latest - environment: - name: ${{ github.event.inputs.environment }} - concurrency: ${{github.event.inputs.environment}} - steps: - - name: Install Cloud Foundry - run: | - wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - - echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list - sudo apt-get update - sudo apt-get install cf7-cli - - - uses: Azure/login@v1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - - name: Fetch secrets from key vault - uses: azure/CLI@v1 - id: fetch-secrets - with: - inlineScript: | - SECRET_VALUE=$(az keyvault secret show --name "PAAS-USERNAME" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv) - echo "::add-mask::$SECRET_VALUE" - echo "PAAS-USERNAME=$SECRET_VALUE" >> $GITHUB_OUTPUT - SECRET_VALUE=$(az keyvault secret show --name "PAAS-PASSWORD" --vault-name "${{ secrets.INFRA_KEY_VAULT}}" --query "value" -o tsv) - echo "::add-mask::$SECRET_VALUE" - echo "PAAS-PASSWORD=$SECRET_VALUE" >> $GITHUB_OUTPUT - - - name: Login to Cloud Foundry - run: cf login -a api.london.cloud.service.gov.uk -u ${{ steps.fetch-secrets.outputs.PAAS-USERNAME}} -p ${{ steps.fetch-secrets.outputs.PAAS-PASSWORD}} -s get-into-teaching - - - name: Fix Development Policies - if: github.event.inputs.environment == 'Development' - run: | - cf target -s get-into-teaching - cf add-network-policy prometheus-dev-get-into-teaching get-into-teaching-app-dev --protocol tcp --port 3000 - cf add-network-policy prometheus-dev-get-into-teaching get-teacher-training-adviser-service-dev --protocol tcp --port 3000 - - - name: Fix Test Policies - if: github.event.inputs.environment == 'Test' - run: | - cf target -s get-into-teaching-monitoring - cf add-network-policy prometheus-prod-get-into-teaching get-into-teaching-app-test -s get-into-teaching-test --protocol tcp --port 3000 - cf add-network-policy prometheus-prod-get-into-teaching get-teacher-training-adviser-service-test -s get-into-teaching-test --protocol tcp --port 3000 - cf add-network-policy prometheus-prod-get-into-teaching get-into-teaching-app-pagespeed -s get-into-teaching-test --protocol tcp --port 3000 - - - name: Fix Production Policies - if: github.event.inputs.environment == 'Production' - run: | - cf target -s get-into-teaching-monitoring - cf add-network-policy prometheus-prod-get-into-teaching get-into-teaching-app-prod -s get-into-teaching-production --protocol tcp --port 3000 - cf add-network-policy prometheus-prod-get-into-teaching get-teacher-training-adviser-service-prod -s get-into-teaching-production --protocol tcp --port 3000