From 3771844816062bc3f57ac63fc6870a4b4b468f15 Mon Sep 17 00:00:00 2001 From: catherine meng Date: Thu, 7 Jul 2022 12:26:40 -0700 Subject: [PATCH] feat: disabled production deploy for now; updated app title and default content --- .github/openshift/networkPolicies.yml | 2 +- .github/workflows/merge-main.yml | 170 +++++++++++++------------- frontend/src/App.vue | 4 +- frontend/src/common/MainHeader.vue | 2 +- 4 files changed, 88 insertions(+), 90 deletions(-) diff --git a/.github/openshift/networkPolicies.yml b/.github/openshift/networkPolicies.yml index b3bdbdb230..77e6455cdd 100644 --- a/.github/openshift/networkPolicies.yml +++ b/.github/openshift/networkPolicies.yml @@ -3,7 +3,7 @@ kind: Template metadata: name: ${NAME} annotations: - description: "Nr-Forest-Client" + description: "NR-Forest-Client" tags: "nrfl" iconClass: icon-js objects: diff --git a/.github/workflows/merge-main.yml b/.github/workflows/merge-main.yml index 876b4b765e..4f86380afa 100644 --- a/.github/workflows/merge-main.yml +++ b/.github/workflows/merge-main.yml @@ -281,88 +281,88 @@ jobs: allow_issue_writing: false fail_action: false - deploy-prod: - name: PROD Deployment - needs: - - zap-backend - - zap-frontend - runs-on: ubuntu-latest - environment: - name: prod - env: - ZONE: prod - PREV: test - steps: - - uses: actions/checkout@v2 - - name: Deploy - run: | - # Login to OpenShift and select project - oc login --token=${{ secrets.OC_TOKEN }} --server=${{ secrets.OC_SERVER }} - oc project ${{ secrets.OC_NAMESPACE }} - - # Clear stale images for import/replacement - if [ $(oc get is -l app=${{ env.NAME }}-${{ env.ZONE }} -o name | grep -v database | wc -l) -gt 0 ]; then - oc delete is -l app=${{ env.NAME }}-${{ env.ZONE }} - fi - - # Cancel db backup rollout if exists - if [ $(oc get dc -l app=backup-container -o name | wc -l) -gt 0 ]; then - oc rollout cancel dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup 2> /dev/null \ - || true && echo "No rollout in progress" - fi - - # Create frontend config (Remove the old one if exists) - oc delete configmap ${{ env.NAME }}-${{ env.ZONE }}-frontend 2> /dev/null \ - || true && echo "No existing frontend config" - oc create configmap ${{ env.NAME }}-${{ env.ZONE }}-frontend \ - --from-literal=config.js="const config = (() => { return { VITE_BACKEND_URL: 'https://${{ env.NAME }}-${{ env.ZONE }}-backend.apps.silver.devops.gov.bc.ca'}; })();" - - # Process and apply deployment templates - oc process -f .github/openshift/deploy.database.yml -p ZONE=${{ env.ZONE }} | oc apply -f - - oc process -f .github/openshift/deploy.backend.yml -p ZONE=${{ env.ZONE }} \ - -p PROMOTE=${{ github.repository }}:${{ env.PREV }}-backend \ - -p EMAIL_USERNAME=${{ secrets.CHES_SERVICE_CLIENT }} \ - -p EMAIL_PASSWORD=${{ secrets.CHES_CLIENT_PASSWORD }} \ - -p EMAIL_TOKEN_URL='https://oidc.gov.bc.ca/auth/realms/jbd6rnxw/protocol/openid-connect/token' \ - -p EMAIL_API_URL='https://ches.apps.silver.devops.gov.bc.ca/api/v1' \ - -p NODE_ENV='production' | oc apply -f - - oc process -f .github/openshift/deploy.frontend.yml -p ZONE=${{ env.ZONE }} \ - -p PROMOTE=${{ github.repository }}:${{ env.PREV }}-frontend | oc apply -f - - - # Follow any active rollouts (see deploymentconfigs) - oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-database -w - oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-backend -w - oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-frontend -w - - # Remove completed build runs, build pods and deployment pods - for p in $(oc get po | grep "Completed" | awk '{print $1}') - do - oc delete po ${p} - done - - # Restart db backup rollout if exists - if [ $(oc get dc -l app=backup-container -o name | wc -l) -gt 0 ]; then - oc rollout latest dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup 2> /dev/null \ - || true && echo "Rollout in progress" - oc logs -f dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup - fi - - - name: Promote Backend Image to PROD - uses: shrink/actions-docker-registry-tag@v2 - with: - registry: ghcr.io - repository: ${{ github.repository }} - token: ${{ secrets.GHCR_TOKEN }} - target: ${{ env.PREV }}-backend - tags: | - prod-backend - - - name: Promote Frontend Image to PROD - uses: shrink/actions-docker-registry-tag@v2 - with: - registry: ghcr.io - repository: ${{ github.repository }} - token: ${{ secrets.GHCR_TOKEN }} - target: ${{ env.PREV }}-frontend - tags: | - prod-frontend + # deploy-prod: + # name: PROD Deployment + # needs: + # - zap-backend + # - zap-frontend + # runs-on: ubuntu-latest + # environment: + # name: prod + # env: + # ZONE: prod + # PREV: test + # steps: + # - uses: actions/checkout@v2 + # - name: Deploy + # run: | + # # Login to OpenShift and select project + # oc login --token=${{ secrets.OC_TOKEN }} --server=${{ secrets.OC_SERVER }} + # oc project ${{ secrets.OC_NAMESPACE }} + + # # Clear stale images for import/replacement + # if [ $(oc get is -l app=${{ env.NAME }}-${{ env.ZONE }} -o name | grep -v database | wc -l) -gt 0 ]; then + # oc delete is -l app=${{ env.NAME }}-${{ env.ZONE }} + # fi + + # # Cancel db backup rollout if exists + # if [ $(oc get dc -l app=backup-container -o name | wc -l) -gt 0 ]; then + # oc rollout cancel dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup 2> /dev/null \ + # || true && echo "No rollout in progress" + # fi + + # # Create frontend config (Remove the old one if exists) + # oc delete configmap ${{ env.NAME }}-${{ env.ZONE }}-frontend 2> /dev/null \ + # || true && echo "No existing frontend config" + # oc create configmap ${{ env.NAME }}-${{ env.ZONE }}-frontend \ + # --from-literal=config.js="const config = (() => { return { VITE_BACKEND_URL: 'https://${{ env.NAME }}-${{ env.ZONE }}-backend.apps.silver.devops.gov.bc.ca'}; })();" + + # # Process and apply deployment templates + # oc process -f .github/openshift/deploy.database.yml -p ZONE=${{ env.ZONE }} | oc apply -f - + # oc process -f .github/openshift/deploy.backend.yml -p ZONE=${{ env.ZONE }} \ + # -p PROMOTE=${{ github.repository }}:${{ env.PREV }}-backend \ + # -p EMAIL_USERNAME=${{ secrets.CHES_SERVICE_CLIENT }} \ + # -p EMAIL_PASSWORD=${{ secrets.CHES_CLIENT_PASSWORD }} \ + # -p EMAIL_TOKEN_URL='https://oidc.gov.bc.ca/auth/realms/jbd6rnxw/protocol/openid-connect/token' \ + # -p EMAIL_API_URL='https://ches.apps.silver.devops.gov.bc.ca/api/v1' \ + # -p NODE_ENV='production' | oc apply -f - + # oc process -f .github/openshift/deploy.frontend.yml -p ZONE=${{ env.ZONE }} \ + # -p PROMOTE=${{ github.repository }}:${{ env.PREV }}-frontend | oc apply -f - + + # # Follow any active rollouts (see deploymentconfigs) + # oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-database -w + # oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-backend -w + # oc rollout status dc/${{ env.NAME }}-${{ env.ZONE }}-frontend -w + + # # Remove completed build runs, build pods and deployment pods + # for p in $(oc get po | grep "Completed" | awk '{print $1}') + # do + # oc delete po ${p} + # done + + # # Restart db backup rollout if exists + # if [ $(oc get dc -l app=backup-container -o name | wc -l) -gt 0 ]; then + # oc rollout latest dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup 2> /dev/null \ + # || true && echo "Rollout in progress" + # oc logs -f dc/${{ env.NAME }}-${{ env.ZONE }}-dbbackup + # fi + + # - name: Promote Backend Image to PROD + # uses: shrink/actions-docker-registry-tag@v2 + # with: + # registry: ghcr.io + # repository: ${{ github.repository }} + # token: ${{ secrets.GHCR_TOKEN }} + # target: ${{ env.PREV }}-backend + # tags: | + # prod-backend + + # - name: Promote Frontend Image to PROD + # uses: shrink/actions-docker-registry-tag@v2 + # with: + # registry: ghcr.io + # repository: ${{ github.repository }} + # token: ${{ secrets.GHCR_TOKEN }} + # target: ${{ env.PREV }}-frontend + # tags: | + # prod-frontend diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 73c277d0cb..e219e1ed0a 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,7 +2,7 @@
- + Hello World
@@ -10,13 +10,11 @@