From f81785c9b46112788c596ed48d0b9a597b4350da Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Fri, 4 Oct 2024 22:53:23 -0400 Subject: [PATCH 1/4] Update egress proxy deployment steps This changeset updates the egress proxy deployment steps to match the admin repo, based on lessons learned there. Signed-off-by: Carlo Costino --- .github/actions/deploy-proxy/action.yml | 13 +++++++++++++ .github/workflows/deploy.yml | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy-proxy/action.yml b/.github/actions/deploy-proxy/action.yml index 13bdc494f..339d1fc78 100644 --- a/.github/actions/deploy-proxy/action.yml +++ b/.github/actions/deploy-proxy/action.yml @@ -16,6 +16,19 @@ inputs: runs: using: composite steps: + - name: Install cf-cli + shell: bash + run: | + curl -A "cg-deploy-action" -v -L -o cf-cli_amd64.deb 'https://packages.cloudfoundry.org/stable?release=debian64&version=v8&source=github' + sudo dpkg -i cf-cli_amd64.deb + - name: Login to cf-cli + shell: bash + run: | + cf api api.fr.cloud.gov + cf auth + - name: Target org and space + shell: bash + run: cf target -o ${{ inputs.cf_org }} -s ${{ inputs.cf_space }} - name: Set restricted space egress shell: bash run: ./terraform/set_space_egress.sh -t -s ${{ inputs.cf_space }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6145bf296..f1fdf9df6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -101,9 +101,12 @@ jobs: .github/actions/deploy-proxy/action.yml .github/workflows/deploy.yml - name: Deploy egress proxy - if: steps.changed-egress-config.outputs.any_changed == 'true' + #if: steps.changed-egress-config.outputs.any_changed == 'true' uses: ./.github/actions/deploy-proxy with: + cf_username: ${{ secrets.CLOUDGOV_USERNAME }} + cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} + cf_org: gsa-tts-benefits-studio cf_space: notify-staging app: notify-api-staging From c2f2e36262810c330e663a0fa9bbd19fd62ca52b Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Wed, 9 Oct 2024 13:52:01 -0600 Subject: [PATCH 2/4] Added missing egress proxy deploy action inputs Signed-off-by: Carlo Costino --- .github/actions/deploy-proxy/action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/actions/deploy-proxy/action.yml b/.github/actions/deploy-proxy/action.yml index 339d1fc78..393dd4b45 100644 --- a/.github/actions/deploy-proxy/action.yml +++ b/.github/actions/deploy-proxy/action.yml @@ -1,6 +1,15 @@ name: Deploy egress proxy description: Set egress space security groups and deploy proxy inputs: + cf_username: + description: The username to authenticate with. + required: true + cf_password: + description: The password to authenticate with. + required: true + cf_org: + description: The org the target app exists in. + required: true cf_space: description: The space the target app exists in. required: true From 22bb1d0b8c4fcc53b4f3ec43c28bbde248d3447e Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Wed, 9 Oct 2024 14:23:25 -0600 Subject: [PATCH 3/4] Swap config vars for env vars Signed-off-by: Carlo Costino --- .github/actions/deploy-proxy/action.yml | 6 ------ .github/workflows/deploy.yml | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/actions/deploy-proxy/action.yml b/.github/actions/deploy-proxy/action.yml index 393dd4b45..0ffc05066 100644 --- a/.github/actions/deploy-proxy/action.yml +++ b/.github/actions/deploy-proxy/action.yml @@ -1,12 +1,6 @@ name: Deploy egress proxy description: Set egress space security groups and deploy proxy inputs: - cf_username: - description: The username to authenticate with. - required: true - cf_password: - description: The password to authenticate with. - required: true cf_org: description: The org the target app exists in. required: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f1fdf9df6..cdcae16d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -103,9 +103,10 @@ jobs: - name: Deploy egress proxy #if: steps.changed-egress-config.outputs.any_changed == 'true' uses: ./.github/actions/deploy-proxy + env: + CF_USERNAME: ${{ secrets.CF_USERNAME }} + CF_PASSWORD: ${{ secrets.CF_PASSWORD }} with: - cf_username: ${{ secrets.CLOUDGOV_USERNAME }} - cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} cf_org: gsa-tts-benefits-studio cf_space: notify-staging app: notify-api-staging From f644f5250ca72832f036d1c640e97687daff5178 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Thu, 10 Oct 2024 13:10:01 -0400 Subject: [PATCH 4/4] Fix environment name references for CF Signed-off-by: Carlo Costino --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cdcae16d4..43296f9c7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -104,8 +104,8 @@ jobs: #if: steps.changed-egress-config.outputs.any_changed == 'true' uses: ./.github/actions/deploy-proxy env: - CF_USERNAME: ${{ secrets.CF_USERNAME }} - CF_PASSWORD: ${{ secrets.CF_PASSWORD }} + CF_USERNAME: ${{ secrets.CLOUDGOV_USERNAME }} + CF_PASSWORD: ${{ secrets.CLOUDGOV_PASSWORD }} with: cf_org: gsa-tts-benefits-studio cf_space: notify-staging