From 784ad795e80c3a5b4917eae37243bffc64ac1342 Mon Sep 17 00:00:00 2001 From: Dom Clayton Date: Tue, 29 Oct 2024 14:14:38 +0000 Subject: [PATCH] Updated tests --- .github/workflows/fib_app_v1_tests.yaml | 3 + .../validate_fibonacci_v1_infra.yaml | 595 +++++++++--------- 2 files changed, 299 insertions(+), 299 deletions(-) diff --git a/.github/workflows/fib_app_v1_tests.yaml b/.github/workflows/fib_app_v1_tests.yaml index 1d8cdf1..d0df33c 100644 --- a/.github/workflows/fib_app_v1_tests.yaml +++ b/.github/workflows/fib_app_v1_tests.yaml @@ -48,6 +48,9 @@ jobs: export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} export ARM_USE_AZUREAD=true + export STORAGE_ACCOUNT_NAME=${{ vars.STATE_STORAGE_ACCOUNT }}" \ + export CONTAINER_NAME=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ + export KEY=${{ vars.FB_STATE_FILE_NAME }}" export DOCKER_IMAGE_TAG=sbx export PSQL_ADMIN_PASSWORD=${{ secrets.PSQL_ADMIN_PASSWORD }} export PSQL_ADMIN_USERNAME=${{ secrets.PSQL_ADMIN_USERNAME }} diff --git a/.github/workflows/validate_fibonacci_v1_infra.yaml b/.github/workflows/validate_fibonacci_v1_infra.yaml index f551aa3..d41aa67 100644 --- a/.github/workflows/validate_fibonacci_v1_infra.yaml +++ b/.github/workflows/validate_fibonacci_v1_infra.yaml @@ -18,9 +18,6 @@ jobs: secrets: API_KEY: ${{ secrets.INFRACOST_API_KEY }} - #scan_iac: - # uses: - plan_fibonacci_v1: runs-on: ubuntu-latest name: Plan Fibonacci V1 using Terraform @@ -47,315 +44,315 @@ jobs: IP_ADDR=$(curl -s https://ifconfig.me/ip) echo "IPADDR=$IP_ADDR" >> $GITHUB_OUTPUT - - name: modify state storage acl - run: | - az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - echo "Pausing for 60 seconds to ensure the ACL has been set..." - sleep 60 + # - name: modify state storage acl + # run: | + # az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + # echo "Pausing for 60 seconds to ensure the ACL has been set..." + # sleep 60 - - name: install terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ vars.TERRAFORM_VERSION }} + # - name: install terraform + # uses: hashicorp/setup-terraform@v3 + # with: + # terraform_version: ${{ vars.TERRAFORM_VERSION }} - - name: Terraform fmt - id: fmt - run: terraform fmt -check - continue-on-error: true - - - name: terraform init - id: init - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true + # - name: Terraform fmt + # id: fmt + # run: terraform fmt -check + # continue-on-error: true + + # - name: terraform init + # id: init + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true - terraform init \ - -upgrade \ - -input=false \ - -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ - -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ - -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" + # terraform init \ + # -upgrade \ + # -input=false \ + # -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ + # -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ + # -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" - - name: Terraform Validate - id: validate - run: terraform validate -no-color - - - name: terraform plan - id: plan - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true - export TF_VAR_docker_image_tag=sbx - export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} - export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} - - terraform plan -no-color -out out.tfplan - - terraform show -no-color out.tfplan > plan.md - - sed -i '3 i\```' plan.md - echo '```' >> plan.md - - cat plan.md > $GITHUB_STEP_SUMMARY - - - name: Add Comment to PR - uses: actions/github-script@v7 - env: - PLAN: ${{ steps.plan.outputs.stdout }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` -
Formatting Output - - \`\`\`\n - ${{ steps.fmt.outputs.stdout }} - \`\`\` - -
- - #### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` -
Validation Output - - \`\`\`\n - ${{ steps.validate.outputs.stdout }} - \`\`\` - -
+ # - name: Terraform Validate + # id: validate + # run: terraform validate -no-color + + # - name: terraform plan + # id: plan + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true + # export TF_VAR_docker_image_tag=sbx + # export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} + # export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} + + # terraform plan -no-color -out out.tfplan + + # terraform show -no-color out.tfplan > plan.md + + # sed -i '3 i\```' plan.md + # echo '```' >> plan.md + + # cat plan.md > $GITHUB_STEP_SUMMARY + + # - name: Add Comment to PR + # uses: actions/github-script@v7 + # env: + # PLAN: ${{ steps.plan.outputs.stdout }} + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` + #
Formatting Output + + # \`\`\`\n + # ${{ steps.fmt.outputs.stdout }} + # \`\`\` + + #
+ + # #### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` + #
Validation Output + + # \`\`\`\n + # ${{ steps.validate.outputs.stdout }} + # \`\`\` + + #
- #### Terraform Plan 📖\`${{ steps.plan.outcome }}\` - -
Show Plan - - \`\`\`\n - ${process.env.PLAN} - \`\`\` - -
- - Pusher: @${{ github.actor }} - Action: ${{ github.event_name }} - Workflow: ${{ github.workflow }}`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) - - - name: modify state storage acl - clean up - if: always() - run: | - az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - - deploy_infra_to_sandbox: - runs-on: ubuntu-latest - name: Deploy Infrastructure using Terraform - needs: [ - plan_fibonacci_v1 - ] - - defaults: - run: - working-directory: ./iac/fibonacci_app_v1 - - steps: - - name: checkout repository - uses: actions/checkout@v3 - - - name: auth - uses: azure/login@v2 - with: - creds: '{"clientId": "${{ secrets.ARM_CLIENT_ID }}", "clientSecret": "${{ secrets.ARM_CLIENT_SECRET }}", "tenantId": "${{ secrets.ARM_TENANT_ID }}", "subscriptionId": "${{ vars.ARM_SUBSCRIPTION_ID }}"}' - - - name: get runner ip - id: runner_ip - run: | - IP_ADDR=$(curl -s https://ifconfig.me/ip) - echo "IPADDR=$IP_ADDR" >> $GITHUB_OUTPUT - - - name: modify state storage acl - run: | - az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - echo "Pausing for 60 seconds to ensure the ACL has been set..." - sleep 60 - - - name: install terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ vars.TERRAFORM_VERSION }} + # #### Terraform Plan 📖\`${{ steps.plan.outcome }}\` + + #
Show Plan + + # \`\`\`\n + # ${process.env.PLAN} + # \`\`\` + + #
+ + # Pusher: @${{ github.actor }} + # Action: ${{ github.event_name }} + # Workflow: ${{ github.workflow }}`; + + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: output + # }) + + # - name: modify state storage acl - clean up + # if: always() + # run: | + # az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + + # deploy_infra_to_sandbox: + # runs-on: ubuntu-latest + # name: Deploy Infrastructure using Terraform + # needs: [ + # plan_fibonacci_v1 + # ] + + # defaults: + # run: + # working-directory: ./iac/fibonacci_app_v1 + + # steps: + # - name: checkout repository + # uses: actions/checkout@v3 + + # - name: auth + # uses: azure/login@v2 + # with: + # creds: '{"clientId": "${{ secrets.ARM_CLIENT_ID }}", "clientSecret": "${{ secrets.ARM_CLIENT_SECRET }}", "tenantId": "${{ secrets.ARM_TENANT_ID }}", "subscriptionId": "${{ vars.ARM_SUBSCRIPTION_ID }}"}' + + # - name: get runner ip + # id: runner_ip + # run: | + # IP_ADDR=$(curl -s https://ifconfig.me/ip) + # echo "IPADDR=$IP_ADDR" >> $GITHUB_OUTPUT + + # - name: modify state storage acl + # run: | + # az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + # echo "Pausing for 60 seconds to ensure the ACL has been set..." + # sleep 60 + + # - name: install terraform + # uses: hashicorp/setup-terraform@v3 + # with: + # terraform_version: ${{ vars.TERRAFORM_VERSION }} - - name: terraform init - id: init - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true + # - name: terraform init + # id: init + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true - terraform init \ - -upgrade \ - -input=false \ - -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ - -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ - -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" - - - name: terraform apply - id: apply - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true - export TF_VAR_docker_image_tag=sbx - export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} - export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} + # terraform init \ + # -upgrade \ + # -input=false \ + # -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ + # -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ + # -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" + + # - name: terraform apply + # id: apply + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true + # export TF_VAR_docker_image_tag=sbx + # export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} + # export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} - terraform apply --auto-approve - - - name: modify state storage acl - clean up - if: always() - run: | - az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - - - name: Add Comment to PR - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `#### Terraform Apply :heavy_check_mark: \`${{ steps.apply.outcome }}\` + # terraform apply --auto-approve + + # - name: modify state storage acl - clean up + # if: always() + # run: | + # az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + + # - name: Add Comment to PR + # uses: actions/github-script@v7 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const output = `#### Terraform Apply :heavy_check_mark: \`${{ steps.apply.outcome }}\` - #### Check :mag: - Sandbox deployment is correct...`; + # #### Check :mag: - Sandbox deployment is correct...`; - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) - - check_deployment_to_sandbox: - runs-on: ubuntu-latest - name: Check the sandbox deployment - environment: sandbox - needs: deploy_infra_to_sandbox - - defaults: - run: - working-directory: ./iac/fibonacci_app_v1 + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: output + # }) + + # check_deployment_to_sandbox: + # runs-on: ubuntu-latest + # name: Check the sandbox deployment + # environment: sandbox + # needs: deploy_infra_to_sandbox + + # defaults: + # run: + # working-directory: ./iac/fibonacci_app_v1 - steps: - - name: Add Comment to PR - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `#### Manual check complete :mag:`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) + # steps: + # - name: Add Comment to PR + # uses: actions/github-script@v7 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const output = `#### Manual check complete :mag:`; + + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: output + # }) - destroy_sandbox_infra: - runs-on: ubuntu-latest - name: Destroy Infrastructure using Terraform - needs: check_deployment_to_sandbox - - defaults: - run: - working-directory: ./iac/fibonacci_app_v1 - - steps: - - name: checkout repository - uses: actions/checkout@v3 - - - name: auth - uses: azure/login@v2 - with: - creds: '{"clientId": "${{ secrets.ARM_CLIENT_ID }}", "clientSecret": "${{ secrets.ARM_CLIENT_SECRET }}", "tenantId": "${{ secrets.ARM_TENANT_ID }}", "subscriptionId": "${{ vars.ARM_SUBSCRIPTION_ID }}"}' - - - name: get runner ip - id: runner_ip - run: | - IP_ADDR=$(curl -s https://ifconfig.me/ip) - echo "IPADDR=$IP_ADDR" >> $GITHUB_OUTPUT - - - name: modify state storage acl - run: | - az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - echo "Pausing for 60 seconds to ensure the ACL has been set..." - sleep 60 - - - name: install terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_version: ${{ vars.TERRAFORM_VERSION }} + # destroy_sandbox_infra: + # runs-on: ubuntu-latest + # name: Destroy Infrastructure using Terraform + # needs: check_deployment_to_sandbox + + # defaults: + # run: + # working-directory: ./iac/fibonacci_app_v1 + + # steps: + # - name: checkout repository + # uses: actions/checkout@v3 + + # - name: auth + # uses: azure/login@v2 + # with: + # creds: '{"clientId": "${{ secrets.ARM_CLIENT_ID }}", "clientSecret": "${{ secrets.ARM_CLIENT_SECRET }}", "tenantId": "${{ secrets.ARM_TENANT_ID }}", "subscriptionId": "${{ vars.ARM_SUBSCRIPTION_ID }}"}' + + # - name: get runner ip + # id: runner_ip + # run: | + # IP_ADDR=$(curl -s https://ifconfig.me/ip) + # echo "IPADDR=$IP_ADDR" >> $GITHUB_OUTPUT + + # - name: modify state storage acl + # run: | + # az storage account network-rule add --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + # echo "Pausing for 60 seconds to ensure the ACL has been set..." + # sleep 60 + + # - name: install terraform + # uses: hashicorp/setup-terraform@v3 + # with: + # terraform_version: ${{ vars.TERRAFORM_VERSION }} - - name: terraform init - id: init - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true + # - name: terraform init + # id: init + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true - terraform init \ - -upgrade \ - -input=false \ - -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ - -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ - -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" - - - name: terraform apply - id: destroy - run: | - # export variables as environment variables - export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} - export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} - export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} - export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} - export ARM_USE_AZUREAD=true - export TF_VAR_docker_image_tag=sbx - export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} - export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} + # terraform init \ + # -upgrade \ + # -input=false \ + # -backend-config="storage_account_name=${{ vars.STATE_STORAGE_ACCOUNT }}" \ + # -backend-config="container_name=${{ vars.FB_STATE_STORAGE_CONTAINER }}" \ + # -backend-config="key=${{ vars.FB_STATE_FILE_NAME }}" + + # - name: terraform apply + # id: destroy + # run: | + # # export variables as environment variables + # export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} + # export ARM_CLIENT_SECRET=${{ secrets.ARM_CLIENT_SECRET }} + # export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} + # export ARM_SUBSCRIPTION_ID=${{ vars.ARM_SUBSCRIPTION_ID }} + # export ARM_USE_AZUREAD=true + # export TF_VAR_docker_image_tag=sbx + # export TF_VAR_psql_admin_password=${{ secrets.PSQL_ADMIN_PASSWORD }} + # export TF_VAR_psql_admin_username=${{ secrets.PSQL_ADMIN_USERNAME }} - terraform destroy --auto-approve - - - name: modify state storage acl - clean up - if: always() - run: | - az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 - - - name: Add Comment to PR - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const output = `#### Terraform Destroy :heavy_check_mark: \`${{ steps.destroy.outcome }}\` + # terraform destroy --auto-approve + + # - name: modify state storage acl - clean up + # if: always() + # run: | + # az storage account network-rule remove --account-name ${{ vars.STATE_STORAGE_ACCOUNT }} --ip-address ${{ steps.runner_ip.outputs.IPADDR }} --subscription ${{ vars.ARM_SUBSCRIPTION_ID }} > /dev/null 2>&1 + + # - name: Add Comment to PR + # uses: actions/github-script@v7 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # const output = `#### Terraform Destroy :heavy_check_mark: \`${{ steps.destroy.outcome }}\` - #### Sandbox removed! :heavy_check_mark: `; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: output - }) + # #### Sandbox removed! :heavy_check_mark: `; + + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: output + # })