-
Notifications
You must be signed in to change notification settings - Fork 14
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
d538875
commit 391206d
Showing
1 changed file
with
75 additions
and
80 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 |
---|---|---|
|
@@ -45,73 +45,67 @@ jobs: | |
- name: Confirm OpenShift CLI is Available | ||
run: oc version --client | ||
|
||
# set-pre-release: | ||
# name: Calculate pre-release number | ||
# runs-on: ubuntu-latest | ||
# needs: [install-oc] | ||
# outputs: | ||
# PRE_RELEASE: ${{ steps.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
# steps: | ||
# - id: set-pre-release | ||
# run: | | ||
# echo "PRE_RELEASE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | ||
|
||
# build: | ||
# name: Build ZEVA on Openshift | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 60 | ||
# needs: [set-pre-release] | ||
|
||
# env: | ||
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
# steps: | ||
# - name: Check out repository | ||
# uses: actions/[email protected] | ||
# with: | ||
# ref: release-${{ ENV.VERSION }} | ||
|
||
# - 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: | ||
# openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
# insecure_skip_tls_verify: true | ||
# namespace: ${{ env.TOOLS_NAMESPACE }} | ||
|
||
# - name: List ZEVA deployments on Test | ||
# run: | | ||
# helm -n ${{ env.TEST_NAMESPACE }} list | ||
|
||
# - name: Build ZEVA Backend | ||
# run: | | ||
# cd openshift/templates/backend | ||
# oc process -f ./backend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }} | ||
# oc start-build --wait=true zeva-backend-${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
|
||
# - name: Build ZEVA Frontend | ||
# run: | | ||
# cd openshift/templates/frontend | ||
# oc process -f ./frontend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }} | ||
# oc start-build --wait=true zeva-frontend-${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
set-pre-release: | ||
name: Calculate pre-release number | ||
runs-on: ubuntu-latest | ||
needs: [install-oc] | ||
outputs: | ||
PRE_RELEASE: ${{ steps.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
steps: | ||
- id: set-pre-release | ||
run: | | ||
echo "PRE_RELEASE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | ||
build: | ||
name: Build ZEVA on Openshift | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: [set-pre-release] | ||
|
||
env: | ||
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
with: | ||
ref: release-${{ ENV.VERSION }} | ||
|
||
- 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: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
insecure_skip_tls_verify: true | ||
namespace: ${{ env.TOOLS_NAMESPACE }} | ||
|
||
- name: Build ZEVA Backend | ||
run: | | ||
cd openshift/templates/backend | ||
oc process -f ./backend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }} | ||
oc start-build --wait=true zeva-backend-${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
- name: Build ZEVA Frontend | ||
run: | | ||
cd openshift/templates/frontend | ||
oc process -f ./frontend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }} | ||
oc start-build --wait=true zeva-frontend-${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
deploy-on-test: | ||
name: Deploy ZEVA on Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
# needs: [set-pre-release, build] | ||
needs: [install-oc] | ||
needs: [set-pre-release, build] | ||
|
||
env: | ||
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
PRE_RELEASE: "20241217214026" | ||
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
steps: | ||
- name: Ask for approval for ZEVA Test deployment | ||
|
@@ -155,17 +149,17 @@ jobs: | |
helm -n ${{ env.TEST_NAMESPACE }} list | ||
oc tag ${{ env.TOOLS_NAMESPACE }}/zeva-backend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} ${{ env.TEST_NAMESPACE }}/zeva-backend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
oc tag ${{ env.TOOLS_NAMESPACE }}/zeva-frontend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} ${{ env.TEST_NAMESPACE }}/zeva-frontend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
helm -n ${{ env.TEST_NAMESPACE }} list | ||
cd zeva | ||
helm -n ${{ env.TEST_NAMESPACE }} -f ./values-test.yaml upgrade --install zeva-test . | ||
deploy-on-prod: | ||
name: Deploy ZEVA on Prod | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 240 | ||
# needs: [set-pre-release, deploy-on-test] | ||
needs: [deploy-on-test] | ||
needs: [set-pre-release, deploy-on-test] | ||
env: | ||
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
PRE_RELEASE: "20241217214026" | ||
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }} | ||
|
||
steps: | ||
|
||
- name: Ask for approval for ZEVA Prod deployment | ||
|
@@ -176,6 +170,20 @@ jobs: | |
minimum-approvals: 1 | ||
issue-title: "ZEVA ${{ env.VERSION }}-${{ env.PRE_RELEASE }} Prod Deployment" | ||
|
||
- name: Checkout Manifest repository | ||
uses: actions/[email protected] | ||
with: | ||
repository: bcgov-c/tenant-gitops-e52f12 | ||
ref: main | ||
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }} | ||
|
||
- name: Update frontend and backend image tags | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: | | ||
yq -i '.frontend.image.tag = "${{ env.VERSION }}-${{ env.PRE_RELEASE }}"' zeva/values-prod.yaml | ||
yq -i '.backend.image.tag = "${{ env.VERSION }}-${{ env.PRE_RELEASE }}"' zeva/values-prod.yaml | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -190,25 +198,12 @@ jobs: | |
insecure_skip_tls_verify: true | ||
namespace: ${{ env.TOOLS_NAMESPACE }} | ||
|
||
- name: Tag Images from tools to Prod | ||
- name: Tag and Deploy to Prod | ||
run: | | ||
helm -n ${{ env.PROD_NAMESPACE }} list | ||
oc tag ${{ env.TOOLS_NAMESPACE }}/zeva-backend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} ${{ env.PROD_NAMESPACE }}/zeva-backend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
oc tag ${{ env.TOOLS_NAMESPACE }}/zeva-frontend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} ${{ env.PROD_NAMESPACE }}/zeva-frontend:${{ env.VERSION }}-${{ env.PRE_RELEASE }} | ||
- name: Checkout Manifest repository | ||
uses: actions/[email protected] | ||
with: | ||
repository: bcgov-c/tenant-gitops-e52f12 | ||
ref: main | ||
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }} | ||
|
||
- name: Update frontend and backend image tags | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: | | ||
yq -i '.frontend.image.tag = "${{ env.VERSION }}-${{ env.PRE_RELEASE }}"' zeva/values-prod.yaml | ||
yq -i '.backend.image.tag = "${{ env.VERSION }}-${{ env.PRE_RELEASE }}"' zeva/values-prod.yaml | ||
- name: Deploy Zeva on Prod | ||
run: | | ||
pwd | ||
|