-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
2 changed files
with
17 additions
and
20 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 |
---|---|---|
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
@@ -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 }} | ||
|
@@ -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' | ||
|
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 |
---|---|---|
|
@@ -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" | ||
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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 }} | ||
|
@@ -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' | ||
|