From 4e3d0c33f41dcd66c44e878ed3f329f68be70229 Mon Sep 17 00:00:00 2001 From: Tara Epp Date: Fri, 13 Oct 2023 10:24:09 -0600 Subject: [PATCH] add failure notification on timeout --- .github/workflows/testing-workflow.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing-workflow.yaml b/.github/workflows/testing-workflow.yaml index eb39898779..4ebe8029c3 100644 --- a/.github/workflows/testing-workflow.yaml +++ b/.github/workflows/testing-workflow.yaml @@ -3,9 +3,12 @@ name: Testing this as part of a workflow on: pull_request: +env: + ENVIRONMENT: dev + jobs: test-schemaspy-rollout: - name: test-schemaspy-rollout + name: test-schemaspy-rollout runs-on: ubuntu-20.04 steps: - name: Install oc @@ -22,11 +25,17 @@ jobs: - name: Restart SchemaSpy pods run: | - oc -n 4c2ba9-dev rollout restart deployment/schemaspy + oc -n 4c2ba9-${{ env.ENVIRONMENT }} rollout restart deployment/schemaspy - - name: Watch Rollout Status + - name: Watch Rollout Status run: | - oc -n 4c2ba9-dev rollout status deployment/schemaspy + oc -n 4c2ba9-{{ env.ENVIRONMENT }} rollout status deployment/schemaspy + timeout-minutes: 10 - - name: Notification - run: ./gitops/notify_discord.sh schemaspy dev ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 0 \ No newline at end of file + - name: Notify Discord of Rollout success + if: ${{ success() }} + run: ./gitops/notify_discord.sh schemaspy {{ env.ENVIRONMENT }} ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 0 + + - name: Notify Discord of Rollout failure + if: ${{ failure() }} + run: ./gitops/notify_discord.sh schemaspy {{ env.ENVIRONMENT }} ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 1