From 3f071bc0bd7c13a67e49a077b0835c322987d920 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:29:18 -0300 Subject: [PATCH 01/17] debug --- .github/workflows/iac.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index e6fcee58..c12b1cf1 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -164,13 +164,7 @@ jobs: project_id: ${{ inputs.PROJECT_ID }} service_account: ${{ inputs.GCP_SA }} - # - name: 'Authenticate Azure' - # uses: azure/login@v1.5.1 - # if: inputs.AZURE_ENV == true - # with: - # client-id: ${{ secrets.AZURE_CLIENT_ID }} - # tenant-id: ${{ secrets.AZURE_TENANT_ID }} - # subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - run: git init - name: Sops Binary Installer uses: mdgreenwald/mozilla-sops-action@v1.6.0 From 275a45b02bb772f8196deb4979204b8b2f13c54d Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:32:16 -0300 Subject: [PATCH 02/17] debug --- .github/workflows/iac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index c12b1cf1..521a73d8 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -204,7 +204,7 @@ jobs: with: tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} - tg_dir: ${{ inputs.WORKING_DIR }} + tg_dir: /home/runner/_work/${{ github.event.repository.name }}/${{ inputs.WORKING_DIR }} tg_command: 'run-all init' env: # configure git to use custom token to clone repository. From b4a3f14029aadaf351de35937e5c28f36d23905f Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:39:42 -0300 Subject: [PATCH 03/17] debug --- .github/workflows/iac.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 521a73d8..b5fb86cc 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -164,8 +164,6 @@ jobs: project_id: ${{ inputs.PROJECT_ID }} service_account: ${{ inputs.GCP_SA }} - - run: git init - - name: Sops Binary Installer uses: mdgreenwald/mozilla-sops-action@v1.6.0 if: inputs.TELEPORT_APP != '' @@ -204,7 +202,7 @@ jobs: with: tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} - tg_dir: /home/runner/_work/${{ github.event.repository.name }}/${{ inputs.WORKING_DIR }} + tg_dir: /home/runner/work/infrastructure-lives/${{ github.event.repository.name }}/${{ inputs.WORKING_DIR }} tg_command: 'run-all init' env: # configure git to use custom token to clone repository. From 42a1b567f136acb8a1bc386090465951a9148058 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:43:06 -0300 Subject: [PATCH 04/17] debug --- .github/workflows/iac.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index b5fb86cc..57b83a82 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -138,16 +138,16 @@ jobs: - name: cleanup old checkout run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; - - name: 'Checkout' - uses: actions/checkout@v4 - - name: Checkout actions uses: actions/checkout@v4 with: repository: signalwire/actions-template ref: main path: actions - + + - name: 'Checkout' + uses: actions/checkout@v4 + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.2 with: From 4b41ac7dfd3cec48be4aae9d7b8dc63a79b00750 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:43:31 -0300 Subject: [PATCH 05/17] debug --- .github/workflows/iac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 57b83a82..a5b991fe 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -147,7 +147,7 @@ jobs: - name: 'Checkout' uses: actions/checkout@v4 - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.2 with: @@ -202,7 +202,7 @@ jobs: with: tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} - tg_dir: /home/runner/work/infrastructure-lives/${{ github.event.repository.name }}/${{ inputs.WORKING_DIR }} + tg_dir: ${{ inputs.WORKING_DIR }} tg_command: 'run-all init' env: # configure git to use custom token to clone repository. From e42a02c928994ce10855fcea6a618ef16932d627 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:45:17 -0300 Subject: [PATCH 06/17] debug --- .github/workflows/iac.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index a5b991fe..6c36c07d 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -147,7 +147,7 @@ jobs: - name: 'Checkout' uses: actions/checkout@v4 - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.2 with: @@ -202,7 +202,7 @@ jobs: with: tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} - tg_dir: ${{ inputs.WORKING_DIR }} + tg_dir: ${{github.workspace}}/${{ inputs.WORKING_DIR }} tg_command: 'run-all init' env: # configure git to use custom token to clone repository. From 8a9265249b824f3557b1d6455147a34cbb06e77d Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:51:40 -0300 Subject: [PATCH 07/17] debug --- .github/workflows/iac.yml | 41 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 6c36c07d..9aac60ea 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -196,21 +196,32 @@ jobs: - uses: opentofu/setup-opentofu@main - - name: Init - id: init - uses: gruntwork-io/terragrunt-action@v2.1.2 - with: - tf_version: ${{ inputs.TF_VERSION }} - tg_version: ${{ inputs.TG_VERSION }} - tg_dir: ${{github.workspace}}/${{ inputs.WORKING_DIR }} - tg_command: 'run-all init' - env: - # configure git to use custom token to clone repository. - INPUT_PRE_EXEC_1: | - git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" - # print git configuration - INPUT_PRE_EXEC_2: | - git config --global --list + - name: Update Homebrew + run: | + brew update --preinstall + cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/foo.rb" > .github/brew-formulae + + - run: | + brew install terragrunt + brew install terraform + git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" + cd ${{ inputs.WORKING_DIR }} + terragrunt run-all init + # - name: Init + # id: init + # uses: gruntwork-io/terragrunt-action@v2.1.2 + # with: + # tf_version: ${{ inputs.TF_VERSION }} + # tg_version: ${{ inputs.TG_VERSION }} + # tg_dir: ${{github.workspace}}/${{ inputs.WORKING_DIR }} + # tg_command: 'run-all init' + # env: + # # configure git to use custom token to clone repository. + # INPUT_PRE_EXEC_1: | + # git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" + # # print git configuration + # INPUT_PRE_EXEC_2: | + # git config --global --list - name: Validate uses: gruntwork-io/terragrunt-action@v2 From 801856bc824a30094948ec8074fc2a38c9f612eb Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:53:10 -0300 Subject: [PATCH 08/17] debug --- .github/workflows/iac.yml | 41 ++++++++++++++------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 9aac60ea..a3220f58 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -196,32 +196,21 @@ jobs: - uses: opentofu/setup-opentofu@main - - name: Update Homebrew - run: | - brew update --preinstall - cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/foo.rb" > .github/brew-formulae - - - run: | - brew install terragrunt - brew install terraform - git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" - cd ${{ inputs.WORKING_DIR }} - terragrunt run-all init - # - name: Init - # id: init - # uses: gruntwork-io/terragrunt-action@v2.1.2 - # with: - # tf_version: ${{ inputs.TF_VERSION }} - # tg_version: ${{ inputs.TG_VERSION }} - # tg_dir: ${{github.workspace}}/${{ inputs.WORKING_DIR }} - # tg_command: 'run-all init' - # env: - # # configure git to use custom token to clone repository. - # INPUT_PRE_EXEC_1: | - # git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" - # # print git configuration - # INPUT_PRE_EXEC_2: | - # git config --global --list + - name: Init + id: init + uses: gruntwork-io/terragrunt-action@v2 + with: + tf_version: ${{ inputs.TF_VERSION }} + tg_version: ${{ inputs.TG_VERSION }} + tg_dir: ./${{ inputs.WORKING_DIR }} + tg_command: 'run-all init' + env: + # configure git to use custom token to clone repository. + INPUT_PRE_EXEC_1: | + git config --global url."https://user:${{secrets.PAT_GIT}}@github.com".insteadOf "https://github.com" + # print git configuration + INPUT_PRE_EXEC_2: | + git config --global --list - name: Validate uses: gruntwork-io/terragrunt-action@v2 From d9dab6fc6a56dc8ae6adc5d2c1eb62df25bb6eae Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:54:47 -0300 Subject: [PATCH 09/17] debug --- .github/workflows/iac.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index a3220f58..25abeaf1 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -194,16 +194,17 @@ jobs: env: VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }} - - uses: opentofu/setup-opentofu@main + # - uses: opentofu/setup-opentofu@main - name: Init id: init uses: gruntwork-io/terragrunt-action@v2 with: - tf_version: ${{ inputs.TF_VERSION }} + tofu_version: 1.6.0 tg_version: ${{ inputs.TG_VERSION }} tg_dir: ./${{ inputs.WORKING_DIR }} tg_command: 'run-all init' + tg_add_approve: true env: # configure git to use custom token to clone repository. INPUT_PRE_EXEC_1: | From 31e11420e476712ee80828dba551d0234167fb7e Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:56:59 -0300 Subject: [PATCH 10/17] debug --- .github/workflows/iac.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 25abeaf1..bd867ab6 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -147,6 +147,8 @@ jobs: - name: 'Checkout' uses: actions/checkout@v4 + with: + clean: false - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.2 From feb33220a45d0e8639eeb92bf5f56a50c1e20acc Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 13:58:41 -0300 Subject: [PATCH 11/17] debug --- .github/workflows/iac.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index bd867ab6..939bd059 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -197,6 +197,9 @@ jobs: VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }} # - uses: opentofu/setup-opentofu@main + - run: | + ls -la + ls -la ${{ inputs.WORKING_DIR }} - name: Init id: init From 2b0f11e610cdce828d9e712a027adaf8eb6d7067 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:00:05 -0300 Subject: [PATCH 12/17] debug --- .github/workflows/iac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 939bd059..5e1da193 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -200,6 +200,7 @@ jobs: - run: | ls -la ls -la ${{ inputs.WORKING_DIR }} + pwd - name: Init id: init From d511a6674089d36b38aeb49cd7258ccdf4547496 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:02:13 -0300 Subject: [PATCH 13/17] debug --- .github/workflows/iac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 5e1da193..4f8507bc 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -208,7 +208,7 @@ jobs: with: tofu_version: 1.6.0 tg_version: ${{ inputs.TG_VERSION }} - tg_dir: ./${{ inputs.WORKING_DIR }} + tg_dir: ${{ inputs.WORKING_DIR }} tg_command: 'run-all init' tg_add_approve: true env: From 7334e29b9b738565059704b2a4f406e7c0966c9a Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:05:42 -0300 Subject: [PATCH 14/17] debug --- .github/workflows/iac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 4f8507bc..252c2322 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -204,7 +204,7 @@ jobs: - name: Init id: init - uses: gruntwork-io/terragrunt-action@v2 + uses: gruntwork-io/terragrunt-action@v1 with: tofu_version: 1.6.0 tg_version: ${{ inputs.TG_VERSION }} From 3ca5a666212d62a1b21b815423a5dc24f6f569db Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:07:27 -0300 Subject: [PATCH 15/17] debug --- .github/workflows/iac.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index 252c2322..ea31c326 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -199,18 +199,16 @@ jobs: # - uses: opentofu/setup-opentofu@main - run: | ls -la - ls -la ${{ inputs.WORKING_DIR }} - pwd + ${{ inputs.WORKING_DIR }} - name: Init id: init - uses: gruntwork-io/terragrunt-action@v1 + uses: gruntwork-io/terragrunt-action@v2 with: - tofu_version: 1.6.0 + tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} - tg_dir: ${{ inputs.WORKING_DIR }} + tg_dir: ./${{ inputs.WORKING_DIR }} tg_command: 'run-all init' - tg_add_approve: true env: # configure git to use custom token to clone repository. INPUT_PRE_EXEC_1: | From 40189e2cd86507e730818bbed213d7c076cbac73 Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:08:46 -0300 Subject: [PATCH 16/17] debug --- .github/workflows/iac.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index ea31c326..beb5f367 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -196,14 +196,14 @@ jobs: env: VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }} - # - uses: opentofu/setup-opentofu@main - - run: | - ls -la - ${{ inputs.WORKING_DIR }} + - uses: opentofu/setup-opentofu@main + # - run: | + # ls -la + # ${{ inputs.WORKING_DIR }} - name: Init id: init - uses: gruntwork-io/terragrunt-action@v2 + uses: gruntwork-io/terragrunt-action@v1 with: tf_version: ${{ inputs.TF_VERSION }} tg_version: ${{ inputs.TG_VERSION }} From e474031f8ef78e50382a3935703df71a0592f48c Mon Sep 17 00:00:00 2001 From: Lucas Mellos Carlos Date: Mon, 13 May 2024 14:12:07 -0300 Subject: [PATCH 17/17] debug --- .github/workflows/iac.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/iac.yml b/.github/workflows/iac.yml index beb5f367..cba4374c 100644 --- a/.github/workflows/iac.yml +++ b/.github/workflows/iac.yml @@ -218,7 +218,7 @@ jobs: git config --global --list - name: Validate - uses: gruntwork-io/terragrunt-action@v2 + uses: gruntwork-io/terragrunt-action@v1 id: validate with: tf_version: ${{ inputs.TF_VERSION }} @@ -229,7 +229,7 @@ jobs: OVH_CLOUD_PROJECT_SERVICE: ${{ secrets.OVH_CLOUD_PROJECT_SERVICE }} - name: Plan - uses: gruntwork-io/terragrunt-action@v2 + uses: gruntwork-io/terragrunt-action@v1 id: plan continue-on-error: true with: @@ -276,7 +276,7 @@ jobs: - name: Apply if: github.ref == 'refs/heads/main' && github.event_name == 'push' - uses: gruntwork-io/terragrunt-action@v2 + uses: gruntwork-io/terragrunt-action@v1 id: apply with: tf_version: ${{ inputs.TF_VERSION }}