From 636a53e40c6a0291f56eba4086305991a292c11f Mon Sep 17 00:00:00 2001 From: Andrea Grillo Date: Tue, 9 Jan 2024 12:34:01 +0100 Subject: [PATCH] [EC-68] Replace terraform.sh with tf commands (#823) --- .github/workflows/ioweb_prod_cd.yml | 24 ++++++++++++--- .github/workflows/prod_cd_citizen-auth.yml | 36 ++++++++++++++++++---- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ioweb_prod_cd.yml b/.github/workflows/ioweb_prod_cd.yml index 6aeef1060..2cdfea4e6 100644 --- a/.github/workflows/ioweb_prod_cd.yml +++ b/.github/workflows/ioweb_prod_cd.yml @@ -121,6 +121,15 @@ jobs: terraform_version: ${{ needs.terraform_plan_job.outputs.terraform_version }} terraform_wrapper: true + - name: Terraform init common + id: terraform_init_common + shell: bash + working-directory: ${{ env.DIR }}-common + env: + AZURE_ENVIRONMENT: prod + run: | + bash ./terraform.sh init ${{ env.AZURE_ENVIRONMENT }} + - name: Terraform apply common id: terraform_apply_common shell: bash @@ -128,8 +137,16 @@ jobs: env: AZURE_ENVIRONMENT: prod run: | - bash ./terraform.sh apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} - rm -rf tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + terraform apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + + - name: Terraform init weu-prod01 + id: terraform_init_weu-prod01 + shell: bash + working-directory: ${{ env.DIR }}-app + env: + AZURE_ENVIRONMENT: weu-prod01 + run: | + bash ./terraform.sh init ${{ env.AZURE_ENVIRONMENT }} - name: Terraform apply weu-prod01 id: terraform_apply_weu-prod01 @@ -138,5 +155,4 @@ jobs: env: AZURE_ENVIRONMENT: weu-prod01 run: | - bash ./terraform.sh apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} - rm -rf tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + terraform apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} diff --git a/.github/workflows/prod_cd_citizen-auth.yml b/.github/workflows/prod_cd_citizen-auth.yml index 54385aeb5..aa3103410 100644 --- a/.github/workflows/prod_cd_citizen-auth.yml +++ b/.github/workflows/prod_cd_citizen-auth.yml @@ -137,6 +137,15 @@ jobs: terraform_version: ${{ needs.terraform_plan_job.outputs.terraform_version }} terraform_wrapper: true + - name: Terraform init common + id: terraform_init_common + shell: bash + working-directory: ${{ env.DIR }}-common + env: + AZURE_ENVIRONMENT: prod + run: | + bash ./terraform.sh init ${{ env.AZURE_ENVIRONMENT }} + - name: Terraform apply common id: terraform_apply_common shell: bash @@ -144,8 +153,16 @@ jobs: env: AZURE_ENVIRONMENT: prod run: | - bash ./terraform.sh apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} - rm -rf tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + terraform apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + + - name: Terraform init weu-beta + id: terraform_init_weu-beta + shell: bash + working-directory: ${{ env.DIR }}-app + env: + AZURE_ENVIRONMENT: weu-beta + run: | + bash ./terraform.sh init ${{ env.AZURE_ENVIRONMENT }} - name: Terraform apply weu-beta id: terraform_apply_weu-beta @@ -154,8 +171,16 @@ jobs: env: AZURE_ENVIRONMENT: weu-beta run: | - bash ./terraform.sh apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} - rm -rf tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + terraform apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + + - name: Terraform init weu-prod01 + id: terraform_init_weu-prod01 + shell: bash + working-directory: ${{ env.DIR }}-app + env: + AZURE_ENVIRONMENT: weu-prod01 + run: | + bash ./terraform.sh init ${{ env.AZURE_ENVIRONMENT }} - name: Terraform apply weu-prod01 id: terraform_apply_weu-prod01 @@ -164,5 +189,4 @@ jobs: env: AZURE_ENVIRONMENT: weu-prod01 run: | - bash ./terraform.sh apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} - rm -rf tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }} + terraform apply -lock-timeout=3000s -auto-approve -input=false tfplan-${{ env.AZURE_ENVIRONMENT }}-${{ github.sha }}