From 3d305d965bd129851b2fe9bc851a44c576322434 Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 8 Oct 2024 16:08:44 +0100 Subject: [PATCH 1/5] Add lots more debug --- .github/workflows/oracle-db-duplicate.yml | 139 +++++++++++++++++++++- 1 file changed, 135 insertions(+), 4 deletions(-) diff --git a/.github/workflows/oracle-db-duplicate.yml b/.github/workflows/oracle-db-duplicate.yml index db097784..6ea4ae44 100644 --- a/.github/workflows/oracle-db-duplicate.yml +++ b/.github/workflows/oracle-db-duplicate.yml @@ -595,11 +595,11 @@ jobs: run: | export ANSIBLE_CONFIG=$ansible_config ln -s $PWD/roles/ansible/roles $PWD/operations/playbooks/oracle_duplicate/roles - $ansible_playbook_directory/rman-post-duplicate.yml -e ansible_aws_ssm_bucket_name=${{ vars.ANSIBLE_AWS_SSM_BUCKET_NAME }} -i $inventory \ - -e duplicate_target=${{ env.DuplicateTarget }} + # $ansible_playbook_directory/rman-post-duplicate.yml -e ansible_aws_ssm_bucket_name=${{ vars.ANSIBLE_AWS_SSM_BUCKET_NAME }} -i $inventory \ + # -e duplicate_target=${{ env.DuplicateTarget }} - oracle-build-ha-debug: - name: oracle-build-ha-debug + oracle-build-ha-debug-1: + name: oracle-build-ha-debug-1 environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved runs-on: ubuntu-latest container: @@ -619,6 +619,137 @@ jobs: - name: Debug why HA Build is being skipped id: response run: | + echo "DEBUG 1" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-2: + if: ${{ (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') }} + name: oracle-build-ha-debug-2 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 2" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-3: + if: ${{ needs.oracle-rman-post-duplicate.result == 'success' }} + name: oracle-build-ha-debug-3 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 3" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-4: + if: ${{ needs.oracle-rman-post-duplicate.result == 'skipped' }} + name: oracle-build-ha-debug-4 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 4" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-5: + if: ${{ ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} + name: oracle-build-ha-debug-5 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 5" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-6: + if: ${{ (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') && ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} + name: oracle-build-ha-debug-6 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 6" echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" From f502652e0ca1b57ef0eee191fc30d5cbc6bb7a79 Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 8 Oct 2024 16:10:48 +0100 Subject: [PATCH 2/5] Add even more debug --- .github/workflows/oracle-db-duplicate.yml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/oracle-db-duplicate.yml b/.github/workflows/oracle-db-duplicate.yml index 6ea4ae44..19c10686 100644 --- a/.github/workflows/oracle-db-duplicate.yml +++ b/.github/workflows/oracle-db-duplicate.yml @@ -753,6 +753,33 @@ jobs: echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + oracle-build-ha-debug-7: + if: ${{ always() && (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') && ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} + name: oracle-build-ha-debug-7 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 7" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha: if: ${{ (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') && ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} name: oracle-build-ha From d86f6c14d3477c9c513f97406ad0650c499b6482 Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 8 Oct 2024 16:25:16 +0100 Subject: [PATCH 3/5] Add more debug --- .github/workflows/oracle-db-duplicate.yml | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/.github/workflows/oracle-db-duplicate.yml b/.github/workflows/oracle-db-duplicate.yml index 19c10686..6e1ae236 100644 --- a/.github/workflows/oracle-db-duplicate.yml +++ b/.github/workflows/oracle-db-duplicate.yml @@ -780,6 +780,86 @@ jobs: echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + oracle-build-ha-debug-8: + if: ${{ !(needs.oracle-rman-duplicate-check.outputs.RestoreDatetime == '0') }} + name: oracle-build-ha-debug-2 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 8" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-9: + if: ${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime == '' }} + name: oracle-build-ha-debug-2 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 9" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + oracle-build-ha-debug-10: + if: ${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime == null }} + name: oracle-build-ha-debug-10 + environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved + runs-on: ubuntu-latest + container: + image: ghcr.io/ministryofjustice/hmpps-delius-operational-automation:0.78.0 + needs: [oracle-rman-duplicate-check,oracle-rman-post-duplicate] + timeout-minutes: 1440 + continue-on-error: false + env: + DuplicateTarget: ${{ needs.oracle-rman-duplicate-check.outputs.DuplicateTarget }} + TargetHost: ${{ needs.oracle-rman-duplicate-check.outputs.TargetHost }} + SourceConfigVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceConfigVersion }} + SourceCodeVersion: ${{ needs.oracle-rman-duplicate-check.outputs.SourceCodeVersion }} + outputs: + JobId: ${{ github.job }} + steps: + + - name: Debug why HA Build is being skipped + id: response + run: | + echo "DEBUG 10" + echo "needs.oracle-rman-post-duplicate.result: >>${{ needs.oracle-rman-post-duplicate.result }}<<" + echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" + + + oracle-build-ha: if: ${{ (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') && ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} name: oracle-build-ha From 6950ddf3feef5f2a2ceddf84680419d5f9a325d2 Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 8 Oct 2024 16:27:14 +0100 Subject: [PATCH 4/5] Space --- .github/workflows/oracle-db-duplicate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/oracle-db-duplicate.yml b/.github/workflows/oracle-db-duplicate.yml index 6e1ae236..55ecb95e 100644 --- a/.github/workflows/oracle-db-duplicate.yml +++ b/.github/workflows/oracle-db-duplicate.yml @@ -859,7 +859,6 @@ jobs: echo "needs.oracle-rman-duplicate-check.outputs.RestoreDatetime: >>${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime }}<<" - oracle-build-ha: if: ${{ (needs.oracle-rman-duplicate-check.outputs.RestoreDatetime != '0') && ( needs.oracle-rman-post-duplicate.result == 'success' || needs.oracle-rman-post-duplicate.result == 'skipped' ) }} name: oracle-build-ha From 06c209a8cbffd8483121008042ca5b70ecc0dda5 Mon Sep 17 00:00:00 2001 From: Bill Buchan Date: Tue, 8 Oct 2024 16:37:22 +0100 Subject: [PATCH 5/5] Fix names --- .github/workflows/oracle-db-duplicate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/oracle-db-duplicate.yml b/.github/workflows/oracle-db-duplicate.yml index 55ecb95e..1652961e 100644 --- a/.github/workflows/oracle-db-duplicate.yml +++ b/.github/workflows/oracle-db-duplicate.yml @@ -782,7 +782,7 @@ jobs: oracle-build-ha-debug-8: if: ${{ !(needs.oracle-rman-duplicate-check.outputs.RestoreDatetime == '0') }} - name: oracle-build-ha-debug-2 + name: oracle-build-ha-debug-8 environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved runs-on: ubuntu-latest container: @@ -808,7 +808,7 @@ jobs: oracle-build-ha-debug-9: if: ${{ needs.oracle-rman-duplicate-check.outputs.RestoreDatetime == '' }} - name: oracle-build-ha-debug-2 + name: oracle-build-ha-debug-9 environment: ${{ needs.oracle-rman-duplicate-check.outputs.TargetEnvironment }}-preapproved runs-on: ubuntu-latest container: