From 681885a18e9cb0f6026b6706247420c73db107e4 Mon Sep 17 00:00:00 2001 From: Tara Epp Date: Thu, 19 Oct 2023 10:20:42 -0600 Subject: [PATCH] test reusable workflow --- .github/workflows/schemaspy-rollout-dev.yaml | 17 +++++++++++++++++ ...ing-workflow.yaml => schemaspy-rollout.yaml} | 17 +++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/schemaspy-rollout-dev.yaml rename .github/workflows/{testing-workflow.yaml => schemaspy-rollout.yaml} (58%) diff --git a/.github/workflows/schemaspy-rollout-dev.yaml b/.github/workflows/schemaspy-rollout-dev.yaml new file mode 100644 index 0000000000..db285f81cf --- /dev/null +++ b/.github/workflows/schemaspy-rollout-dev.yaml @@ -0,0 +1,17 @@ +name: SchemaSpy - DEV restart rollout + +on: + pull_request: + workflow_dispatch: + push: + branches: + - develop + paths: + - migrations/sql + +jobs: + dev-schemaspy-rollout: + uses: ./.github/workflows/schemaspy-rollout.yaml + with: + environment: dev + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/testing-workflow.yaml b/.github/workflows/schemaspy-rollout.yaml similarity index 58% rename from .github/workflows/testing-workflow.yaml rename to .github/workflows/schemaspy-rollout.yaml index 794a052b66..763b3f1004 100644 --- a/.github/workflows/testing-workflow.yaml +++ b/.github/workflows/schemaspy-rollout.yaml @@ -1,10 +1,11 @@ name: Testing this as part of a workflow on: - pull_request: - -env: - ENVIRONMENT: dev + workflow_call: + inputs: + environment: + required: true + type: string jobs: test-schemaspy-rollout: @@ -25,17 +26,17 @@ jobs: - name: Restart SchemaSpy pods run: | - oc -n 4c2ba9-${{ env.ENVIRONMENT }} rollout restart deployment/schemaspy + oc -n 4c2ba9-${{ inputs.environment }} rollout restart deployment/schemaspy - name: Watch Rollout Status run: | - oc -n 4c2ba9-${{ env.ENVIRONMENT }} rollout status deployment/schemaspy + oc -n 4c2ba9-${{ inputs.environment }} rollout status deployment/schemaspy timeout-minutes: 10 - name: Notify Discord of Rollout success if: ${{ success() }} - run: ./gitops/notify_discord.sh schemaspy ${{ env.ENVIRONMENT }} ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 0 + run: ./gitops/notify_discord.sh schemaspy ${{ inputs.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 + run: ./gitops/notify_discord.sh schemaspy ${{ inputs.environment }} ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 1