-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b49d97
commit af7ee45
Showing
1 changed file
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,11 @@ jobs: | |
outputs: | ||
cache-hit: ${{ steps.cache.outputs.cache-hit }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Set up cache for OpenShift CLI | ||
id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc # Path where the `oc` binary will be installed | ||
path: /usr/local/bin/oc # Path where the `oc` binary will be installed | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Install OpenShift CLI (if not cached) | ||
|
@@ -80,13 +77,17 @@ jobs: | |
timeout-minutes: 60 | ||
|
||
steps: | ||
- id: get-current-time | ||
run: | | ||
echo "CURRENT_TIME=$(TZ='America/Vancouver' date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT | ||
- name: Ask for approval for ITVR Prod deployment | ||
uses: trstringer/[email protected] | ||
with: | ||
secret: ${{ github.TOKEN }} | ||
approvers: emi-hi,tim738745,kuanfandevops,JulianForeman,rogerlcleung | ||
minimum-approvals: 2 | ||
issue-title: "ITVR ${{ needs.get-build-suffix.outputs.BUILD_SUFFIX }} Prod Deployment" | ||
minimum-approvals: 1 | ||
issue-title: "ITVR ${{ needs.get-build-suffix.outputs.BUILD_SUFFIX }} Prod Deployment at ${{ steps.get-current-time.outputs.CURRENT_TIME }}" | ||
|
||
deploy: | ||
name: Deploy ITVR on Prod | ||
|
@@ -122,11 +123,13 @@ jobs: | |
git add itvr/values-prod.yaml | ||
git commit -m "Update the image tag to ${{ env.BUILD_SUFFIX }} on Prod" | ||
git push | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
with: | ||
|
@@ -138,16 +141,13 @@ jobs: | |
- name: Tag and deploy to Prod | ||
run: | | ||
helm -n ${{ env.PROD_NAMESPACE }} list | ||
oc tag ${{ env.TEST_NAMESPACE }}/itvr-backend:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-backend:${{ env.BUILD_SUFFIX }} | ||
oc tag ${{ env.TEST_NAMESPACE }}/itvr-frontend:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-frontend:${{ env.BUILD_SUFFIX }} | ||
oc tag ${{ env.TEST_NAMESPACE }}/itvr-cra:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-cra:${{ env.BUILD_SUFFIX }} | ||
oc tag ${{ env.TEST_NAMESPACE }}/itvr-task-queue:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-task-queue:${{ env.BUILD_SUFFIX }} | ||
- name: Helm Deployment | ||
run: | | ||
cd itvr | ||
helm -n ${{ env.PROD_NAMESPACE }} -f ./values-prod.yaml upgrade --install itvr-prod . \ | ||
--set frontend.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
--set backend.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
--set cra.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
--set task-queue.podAnnotations.rolloutTriggered="A$(date +%s)E" | ||
# oc tag ${{ env.TEST_NAMESPACE }}/itvr-backend:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-backend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.TEST_NAMESPACE }}/itvr-frontend:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-frontend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.TEST_NAMESPACE }}/itvr-cra:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-cra:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.TEST_NAMESPACE }}/itvr-task-queue:${{ env.BUILD_SUFFIX }} ${{ env.PROD_NAMESPACE }}/itvr-task-queue:${{ env.BUILD_SUFFIX }} | ||
# cd itvr | ||
# helm -n ${{ env.PROD_NAMESPACE }} -f ./values-prod.yaml upgrade --install itvr-prod . \ | ||
# --set frontend.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
# --set backend.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
# --set cra.podAnnotations.rolloutTriggered="A$(date +%s)E" \ | ||
# --set task-queue.podAnnotations.rolloutTriggered="A$(date +%s)E" |