From 3d8e47d944da819b820fbad0423e9b69b20912ff Mon Sep 17 00:00:00 2001 From: Sukanya Rath <98050194+sukanya-rath@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:54:04 -0700 Subject: [PATCH] fix: GEO-1090 Hotfix pipeline fixes (#829) Signed-off-by: Sukanya Rath --- .github/workflows/.deploy.yml | 12 ++++++++++-- .../workflows/cd-to-prod-on-workflow-dispatch.yml | 7 ++++++- .../workflows/cd-to-test-on-workflow-dispatch.yml | 8 ++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/.deploy.yml b/.github/workflows/.deploy.yml index cdf5c92e..d5cdacb0 100644 --- a/.github/workflows/.deploy.yml +++ b/.github/workflows/.deploy.yml @@ -71,6 +71,14 @@ jobs: UI_PRIVATE_KEY: | ${{ secrets.UI_PRIVATE_KEY }} steps: + - name: Set Variables + id: vars + shell: bash + run: | + # remove the excess part from semver, for example: x.x.x_* -> x.x.x + semver=$(echo ${{ inputs.semver }} | cut -d'_' -f1) + echo "Semver: $semver" + echo "semver=${semver}" >> $GITHUB_OUTPUT - uses: actions/checkout@v4 name: checkout - name: Login to OpenShift @@ -95,7 +103,7 @@ jobs: - name: Package HELM Chart shell: bash run: | - helm package -u --app-version="${{ inputs.tag }}" --version=${{ inputs.semver }} ./${{ inputs.directory }} + helm package -u --app-version="${{ inputs.tag }}" --version=${{ steps.vars.outputs.semver }} ${{ inputs.directory }} - name: Deploy to OpenShift shell: bash @@ -161,7 +169,7 @@ jobs: --set-string crunchy.pgBackRest.s3.secretKey="${{ secrets.S3_SECRET_ACCESS_KEY }}" \ --set-string global.secrets.clamavApiKey="${{ secrets.CLAMAV_API_KEY }}" \ ${{ inputs.params }} \ - --timeout "$DEPLOY_TIMEOUT"m ./${{ github.event.repository.name }}-${{ inputs.semver }}.tgz + --timeout "$DEPLOY_TIMEOUT"m ./${{ github.event.repository.name }}-${{ steps.vars.outputs.semver }}.tgz - name: Print HELM Chart History shell: bash diff --git a/.github/workflows/cd-to-prod-on-workflow-dispatch.yml b/.github/workflows/cd-to-prod-on-workflow-dispatch.yml index f8f3a79e..fa0e1a58 100644 --- a/.github/workflows/cd-to-prod-on-workflow-dispatch.yml +++ b/.github/workflows/cd-to-prod-on-workflow-dispatch.yml @@ -7,12 +7,18 @@ on: tag: description: "The Docker Tag to deploy, it would be the latest tagged version that you want to deploy from TEST to PROD." required: true + is_hotfix: + description: "Is this a hotfix deployment?" + required: false + default: false + type: boolean concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: image-promotions-to-prod: # This is just for adding another tag to the image to reflect which docker tag is deployed to PROD. + if: ${{ !github.event.inputs.is_hotfix }} name: Image Promotions to PROD runs-on: ubuntu-22.04 permissions: @@ -38,7 +44,6 @@ jobs: tags: prod deploys: name: Deploys (prod) - needs: [image-promotions-to-prod] uses: ./.github/workflows/.deploy.yml secrets: inherit with: diff --git a/.github/workflows/cd-to-test-on-workflow-dispatch.yml b/.github/workflows/cd-to-test-on-workflow-dispatch.yml index 75ad37a6..4793357d 100644 --- a/.github/workflows/cd-to-test-on-workflow-dispatch.yml +++ b/.github/workflows/cd-to-test-on-workflow-dispatch.yml @@ -8,13 +8,18 @@ on: tag: description: "The Docker Tag to deploy, it would be the latest tagged version that you want to deploy from dev to TEST." required: true - + is_hotfix: + description: "Is this a hotfix deployment?" + required: false + default: false + type: boolean concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: image-promotions-to-test: # This is just for adding another tag to the image to reflect which docker tag is deployed to TEST. + if: ${{ !github.event.inputs.is_hotfix }} name: Image Promotions to TEST runs-on: ubuntu-22.04 permissions: @@ -40,7 +45,6 @@ jobs: tags: test deploys: name: Deploys (test) - needs: [image-promotions-to-test] uses: ./.github/workflows/.deploy.yml secrets: inherit with: