Skip to content

Commit

Permalink
refactor: update var names to match renamed repository vars (#446)
Browse files Browse the repository at this point in the history
* refactor: update var names to match renamed repository vars

* refactor: update var names to match renamed repository vars

* refactor: add params for e2etests

* Update cd.yaml
  • Loading branch information
fibble authored Nov 13, 2024
1 parent c9ef8d7 commit 47af994
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
working-directory: app/cdn
env:
ASSET_BUCKET: "vol-app-assets"
AWS_OIDC_ROLE: ${{ vars[format('ACCOUNT_nonprod_TF_OIDC{0}_ROLE', (inputs.push && '' || '_READONLY'))] || (inputs.push && vars.TF_OIDC_ROLE || vars.TF_OIDC_READONLY_ROLE) }}
AWS_REGION: ${{ vars.TF_AWS_REGION }}
AWS_OIDC_ROLE: ${{ vars.ACCOUNT_NONPROD_TF_OIDC_ROLE }}
AWS_REGION: ${{ vars.DVSA_AWS_REGION }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ jobs:
- terraform_env_dev
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
with:
environment: dev
platform_env: dev
aws_role: ${{ vars.ACCOUNT_NONPROD_TEST_OIDC_ROLE }}
bucket_name: ${{ vars.ACCOUNT_NONPROD_S3_REPORT_BUCKET }}
bucket_key: ${{ vars.S3_REPORT_BUCKET_KEY }}
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -338,9 +341,12 @@ jobs:
name: Run Tests on INT
needs:
- terraform_env_int
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@fail
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
with:
environment: int
platform_env: int
aws_role: ${{ vars.ACCOUNT_NONPROD_TEST_OIDC_ROLE }}
bucket_name: ${{ vars.ACCOUNT_NONPROD_S3_REPORT_BUCKET }}
bucket_key: ${{ vars.S3_REPORT_BUCKET_KEY }}
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -423,7 +429,10 @@ jobs:
- terraform_env_prep
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
with:
environment: prep
platform_env: prep
aws_role: ${{ vars.ACCOUNT_PROD_TEST_OIDC_ROLE }}
bucket_name: ${{ vars.ACCOUNT_PROD_S3_REPORT_BUCKET }}
bucket_key: ${{ vars.S3_REPORT_BUCKET_KEY }}
permissions:
contents: write
id-token: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
terraform-output: ${{ steps.terraform-output.outputs.json }}
env:
WORKING_DIR: infra/terraform/accounts/${{ inputs.account }}
AWS_OIDC_ROLE: ${{ vars[format('ACCOUNT_{0}_TF_OIDC{1}_ROLE', inputs.account, (inputs.apply && '' || '_READONLY'))] || (inputs.apply && vars.TF_OIDC_ROLE || vars.TF_OIDC_READONLY_ROLE) }}
AWS_REGION: ${{ vars[format('ACCOUNT_{0}_TF_AWS_REGION', inputs.account)] || vars.TF_AWS_REGION }}
AWS_OIDC_ROLE: ${{ vars[inputs.account == 'prod' && 'ACCOUNT_PROD_TF_OIDC_ROLE' || 'ACCOUNT_NONPROD_TF_OIDC_ROLE'] }}
AWS_REGION: ${{ vars.DVSA_AWS_REGION }}
defaults:
run:
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ jobs:
previous_assets_version: ${{ steps.get_current_versions.outputs.assets_version }}
env:
WORKING_DIR: infra/terraform/environments/${{ inputs.environment }}
AWS_OIDC_ROLE: ${{ vars[format('ENV_{0}_TF_OIDC{1}_ROLE', inputs.environment, (inputs.apply && '' || '_READONLY'))] || (inputs.apply && vars.TF_OIDC_ROLE || vars.TF_OIDC_READONLY_ROLE) }}
AWS_REGION: ${{ vars[format('ENV_{0}_TF_AWS_REGION', inputs.environment)] || vars.TF_AWS_REGION }}
AWS_OIDC_ROLE: ${{ vars[format('ENV_{0}_TF_OIDC_ROLE', inputs.environment)] || vars[(inputs.environment == 'prep' || inputs.environment == 'prod') && 'ACCOUNT_PROD_TF_OIDC_ROLE' || 'ACCOUNT_NONPROD_TF_OIDC_ROLE'] }}
AWS_REGION: ${{ vars.DVSA_AWS_REGION }}
defaults:
run:
shell: bash
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ env:
WORKING_DIR: infra/docker/${{ inputs.project }}
REGISTRY: 054614622558.dkr.ecr.eu-west-1.amazonaws.com
REGISTRY_MIRROR: ghcr.io
AWS_OIDC_ROLE: ${{ vars[format('ACCOUNT_nonprod_TF_OIDC{0}_ROLE', (inputs.push && '' || '_READONLY'))] || (inputs.push && vars.TF_OIDC_ROLE || vars.TF_OIDC_READONLY_ROLE) }}
AWS_REGION: ${{ vars.TF_AWS_REGION }}
AWS_OIDC_ROLE: ${{ vars.ACCOUNT_NONPROD_TF_OIDC_ROLE }}

jobs:
lint:
Expand Down

0 comments on commit 47af994

Please sign in to comment.