diff --git a/.github/workflows/pipelines-root.yml b/.github/workflows/pipelines-root.yml index 5f1fdd51..6960f9e0 100644 --- a/.github/workflows/pipelines-root.yml +++ b/.github/workflows/pipelines-root.yml @@ -39,7 +39,7 @@ on: env: PIPELINES_CLI_VERSION: v0.39.0 - PIPELINES_ACTIONS_VERSION: v3.6.4 + PIPELINES_ACTIONS_VERSION: add-orchestrate-execute-actions BOILERPLATE_VERSION: v0.5.16 GRUNTWORK_INSTALLER_VERSION: v0.0.40 @@ -140,6 +140,13 @@ jobs: PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-infra-root-write-token.outputs.PIPELINES_TOKEN }} + - name: Pre Orchestrate Custom Action + uses: ./pipelines-actions/.github/custom-actions/pre-orchestrate + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-infra-root-write-token.outputs.PIPELINES_TOKEN }} + - name: Pipelines Orchestrate id: orchestrate uses: ./pipelines-actions/.github/actions/pipelines-orchestrate @@ -148,6 +155,14 @@ jobs: PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-infra-root-write-token.outputs.PIPELINES_TOKEN }} + - name: Post Orchestrate Custom Action + uses: ./pipelines-actions/.github/custom-actions/post-orchestrate + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-infra-root-write-token.outputs.PIPELINES_TOKEN }} + jobs: ${{ steps.orchestrate.outputs.jobs }} + outputs: pipelines_jobs: ${{ steps.orchestrate.outputs.jobs }} @@ -299,6 +314,16 @@ jobs: PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} gruntwork_context: ${{ toJson(steps.gruntwork_context.outputs) }} + - name: Pre Execute Custom Action + uses: ./pipelines-actions/.github/custom-actions/pre-execute + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + account_id: ${{ matrix.jobs.AccountId }} + account_name: ${{ matrix.jobs.Name }} + job: ${{ toJson(matrix.jobs) }} + gruntwork_context: ${{ toJson(steps.gruntwork_context.outputs) }} + - name: "[TerragruntExecute]: Authenticate with AWS and then Invoke Terragrunt" id: terragrunt if: ${{ steps.gruntwork_context.outputs.action == 'TERRAGRUNT_EXECUTE' }} @@ -318,6 +343,19 @@ jobs: deploy_branch_name: ${{ steps.gruntwork_context.outputs.deploy_branch_name }} stack_paths: ${{ toJson(matrix.jobs.StackPaths) }} + - name: Post Execute Custom Action + uses: ./pipelines-actions/.github/custom-actions/post-execute + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + account_id: ${{ matrix.jobs.AccountId }} + account_name: ${{ matrix.jobs.Name }} + job: ${{ toJson(matrix.jobs) }} + gruntwork_context: ${{ toJson(steps.gruntwork_context.outputs) }} + formatted_plan_output: ${{ steps.terragrunt.outputs.formatted_plan_output }} + execute_stdout_log: ${{ steps.terragrunt.outputs.execute_stdout_log }} + plan_folder: ${{ steps.terragrunt.outputs.plan_folder }} + - name: Get Logs URL id: get_logs_url uses: ./pipelines-actions/.github/actions/pipelines-get-job-logs-url diff --git a/.github/workflows/pipelines.yml b/.github/workflows/pipelines.yml index 8faf3715..65c2fd56 100644 --- a/.github/workflows/pipelines.yml +++ b/.github/workflows/pipelines.yml @@ -120,6 +120,13 @@ jobs: PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-propose-infra-change-token.outputs.PIPELINES_TOKEN }} + - name: Pre Orchestrate Custom Action + uses: ./pipelines-actions/.github/custom-actions/pre-orchestrate + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-propose-infra-change-token.outputs.PIPELINES_TOKEN }} + - name: Pipelines Orchestrate id: orchestrate uses: ./pipelines-actions/.github/actions/pipelines-orchestrate @@ -128,6 +135,14 @@ jobs: PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-propose-infra-change-token.outputs.PIPELINES_TOKEN }} + - name: Post Orchestrate Custom Action + uses: ./pipelines-actions/.github/custom-actions/post-orchestrate + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-propose-infra-change-token.outputs.PIPELINES_TOKEN }} + jobs: ${{ steps.orchestrate.outputs.jobs }} + outputs: pipelines_jobs: ${{ steps.orchestrate.outputs.jobs }} @@ -206,6 +221,16 @@ jobs: child_account_id: ${{ matrix.jobs.AdditionalData.ChildAccountId }} account_names: ${{ matrix.jobs.AdditionalData.AccountNames }} + - name: Pre Execute Custom Action + uses: ./pipelines-actions/.github/custom-actions/pre-execute + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + account_id: ${{ matrix.jobs.AccountId }} + account_name: ${{ matrix.jobs.Name }} + job: ${{ toJson(matrix.jobs) }} + gruntwork_context: ${{ toJson(steps.gruntwork_context.outputs) }} + - name: "Run terragrunt ${{ steps.gruntwork_context.outputs.terragrunt_command }} in ${{ steps.gruntwork_context.outputs.working_directory }}" id: terragrunt uses: ./pipelines-actions/.github/actions/pipelines-execute @@ -246,6 +271,19 @@ jobs: step_logs_url: ${{ steps.get_logs_url.outputs.step_logs_url }} PR_COMMENT_WRITE_TOKEN: ${{ steps.pipelines-propose-infra-change-token.outputs.PIPELINES_TOKEN }} + - name: Post Execute Custom Action + uses: ./pipelines-actions/.github/custom-actions/post-execute + with: + PIPELINES_GRUNTWORK_READ_TOKEN: ${{ steps.pipelines-gruntwork-read-token.outputs.PIPELINES_TOKEN }} + PIPELINES_CUSTOMER_ORG_READ_TOKEN: ${{ steps.pipelines-customer-org-read-token.outputs.PIPELINES_TOKEN }} + account_id: ${{ matrix.jobs.AccountId }} + account_name: ${{ matrix.jobs.Name }} + job: ${{ toJson(matrix.jobs) }} + gruntwork_context: ${{ toJson(steps.gruntwork_context.outputs) }} + formatted_plan_output: ${{ steps.terragrunt.outputs.formatted_plan_output }} + execute_stdout_log: ${{ steps.terragrunt.outputs.execute_stdout_log }} + plan_folder: ${{ steps.terragrunt.outputs.plan_folder }} + outputs: account_id: ${{ matrix.jobs.AccountId }} branch: ${{ steps.gruntwork_context.outputs.branch }}