Skip to content

Commit

Permalink
Syncing with dev deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
cditcher committed Dec 2, 2024
1 parent 3ae08ae commit 85f6fee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build-n-deploy-frontend-to-ocp-dev-vue3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ env:

# SITE_URL should have no scheme or port. It will be prepended with https://
HOST_ROUTE: educ-grad-admin-${{secrets.GRAD_NAMESPACE_NO_ENV}}-dev.apps.silver.devops.gov.bc.ca
MIN_MEM: "200Mi"
MAX_MEM: "250Mi"

on:
workflow_dispatch:
Expand All @@ -42,10 +44,6 @@ jobs:
runs-on: ubuntu-22.04
environment: dev-vue3

outputs:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}

steps:
- name: Check for required secrets
uses: actions/github-script@v4
Expand Down Expand Up @@ -153,7 +151,7 @@ jobs:
# Login to OpenShift and select project
oc login --token=${{ env.OPENSHIFT_TOKEN }} --server=${{ env.OPENSHIFT_SERVER }}
oc project ${{ env.OPENSHIFT_NAMESPACE }}
# Cancel any rollouts in progress
oc rollout cancel deployment/${{ env.IMAGE_NAME }} 2> /dev/null \
|| true && echo "No rollout in progress"
Expand All @@ -163,7 +161,7 @@ jobs:
-p HOST_ROUTE=${{ env.HOST_ROUTE }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p APP_NAME=educ-grad-admin -p TAG=latest -p MIN_REPLICAS=2 -p MAX_REPLICAS=3 -p MIN_CPU=50m -p MAX_CPU=100m \
-p BASE_URL=${{ env.TARGET_ENV }}.grad.gov.bc.ca -p ENVIRONMENT=${{ env.TARGET_ENV }} -p CERTIFICATE="${{ secrets.CERTIFICATE }}" -p CA_CERT="${{ secrets.CA_CERT }}" -p PRIVATE_KEY="${{ secrets.PRIVATE_KEY }}" \
-p MIN_MEM=200Mi -p MAX_MEM=250Mi | oc apply -n ${{secrets.GRAD_NAMESPACE_NO_ENV}}-dev -f -
-p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} | oc apply -n ${{ env.OPENSHIFT_NAMESPACE }} -f -
# Start rollout (if necessary) and follow it
oc rollout restart deployment/${{ env.IMAGE_NAME }}
Expand All @@ -174,4 +172,5 @@ jobs:
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
target: "https://educ-grad-admin-${{secrets.GRAD_NAMESPACE_NO_ENV}}-dev.apps.silver.devops.gov.bc.ca"
target: 'https://educ-grad-admin-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca'

24 changes: 11 additions & 13 deletions .github/workflows/build-n-deploy-frontend-to-ocp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
DOCKER_ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca/docker-remote
ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca

APP_NAME: 'educ-grad-admin'
APP_NAME: "educ-grad-admin"
REPO_NAME: "educ-grad-admin"
BRANCH: "main"
APP_NAME_FRONTEND: "educ-grad-admin-frontend"
Expand All @@ -29,8 +29,10 @@ env:
TAG: "latest"
TARGET_ENV: "dev"

# SITE_URL should have no scheme or port. It will be prepended with https://
HOST_ROUTE: ${{ secrets.SITE_URL }}
# HOST_ROUTE should have no scheme or port. It will be prepended with https://
HOST_ROUTE: "dev.grad.gov.bc.ca"
MIN_MEM: "200Mi"
MAX_MEM: "250Mi"

on:
workflow_dispatch:
Expand All @@ -42,10 +44,6 @@ jobs:
runs-on: ubuntu-22.04
environment: dev

outputs:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}

steps:
- name: Check for required secrets
uses: actions/github-script@v4
Expand Down Expand Up @@ -157,13 +155,13 @@ jobs:
# Cancel any rollouts in progress
oc rollout cancel deployment/${{ env.IMAGE_NAME }} 2> /dev/null \
|| true && echo "No rollout in progress"
# Process and apply deployment template
oc process -f tools/openshift/frontend-dc.yaml -p REPO_NAME=educ-grad-admin \
-p HOST_ROUTE=educ-grad-admin-bbe4c3-dev.apps.silver.devops.gov.bc.ca -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
# Process template
oc process -f tools/openshift/frontend-dc.yaml -p REPO_NAME=${{ env.REPO_NAME }} \
-p HOST_ROUTE=${{ env.HOST_ROUTE }} -p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p APP_NAME=educ-grad-admin -p TAG=latest -p MIN_REPLICAS=2 -p MAX_REPLICAS=3 -p MIN_CPU=50m -p MAX_CPU=100m \
-p BASE_URL=${{ env.TARGET_ENV }}.grad.gov.bc.ca -p ENVIRONMENT=${{ env.TARGET_ENV }} -p CERTIFICATE="${{ secrets.CERTIFICATE }}" -p CA_CERT="${{ secrets.CA_CERT }}" -p PRIVATE_KEY="${{ secrets.PRIVATE_KEY }}" \
-p MIN_MEM=200Mi -p MAX_MEM=250Mi | oc apply -n bbe4c3-dev -f -
-p MIN_MEM=${{ env.MIN_MEM }} -p MAX_MEM=${{ env.MAX_MEM }} | oc apply -n ${{ env.OPENSHIFT_NAMESPACE }} -f -
# Start rollout (if necessary) and follow it
oc rollout restart deployment/${{ env.IMAGE_NAME }}
Expand All @@ -174,5 +172,5 @@ jobs:
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
target: 'https://educ-grad-admin-bbe4c3-dev.apps.silver.devops.gov.bc.ca'
target: 'https://educ-grad-admin-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca'

0 comments on commit 85f6fee

Please sign in to comment.