Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inject release version env #1672

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ on:
description: 'PR number, test or prod.'
required: true
type: string

appVersion:
description: 'PR number or Github Release Tag.'
required: true
type: string
repository:
description: 'repository name.'
required: false
Expand Down Expand Up @@ -65,7 +68,10 @@ on:
required: true
type: string
default: "demo"

appVersion:
description: 'PR number or Github Release Tag.'
required: true
type: string
repository:
description: 'repository name.'
required: false
Expand Down Expand Up @@ -107,6 +113,7 @@ on:
type: string

env:
app_version: ${{ inputs.appVersion | quote }}
repo_release: ${{ inputs.repository }}-${{ inputs.release }}
package_tag: ${{ inputs.tag }}

Expand Down Expand Up @@ -179,7 +186,8 @@ jobs:
helm upgrade \
--set global.autoscaling=${{ inputs.autoscaling }} \
--set-string global.repository=${{ github.repository }} \
--set-string global.tag=${{ inputs.tag }} \
--set-string global.tag=${{ env.package_tag }} \
--set-string global.appVersion=${{ env.app_version }} \
--install --wait --atomic ${{ env.repo_release }} \
--timeout 10m --force \
--values ${{ inputs.values }} \
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ on:
default: onroutebc-test-vehicles.apps.silver.devops.gov.bc.ca
required: true
type: string
bearer_token:
description: "The bearer token pertaining to the user running the tests"
required: true
type: string

jobs:
loadtests:
Expand All @@ -37,12 +33,11 @@ jobs:
- name: Run All JMeter Tests In tests Folder
uses: rbhadti94/[email protected]
with:
testFilePath: loadtests
testFilePath: loadtests/frontend/orbc_load_test_plan_frontend.jmx
outputReportsFolder: loadtests/results
args: |
--loglevel INFO
--jmeterlogconf=log.conf
-JBEARER_TOKEN=${{inputs.bearer_token}}
-JDOPS_API_URL=${{inputs.dops_api_url}}
-JFRONTEND_API_URL=${{inputs.frontend_api_url}}
-JVEHICLES_API_URL=${{inputs.vehicles_api_url}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
uses: ./.github/workflows/test.yml
secrets: inherit
with:
appVersion: ${{ needs.vars.outputs.pr }}
tag: ${{ needs.vars.outputs.pr }}

promote-images-test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Closed
name: PR Close

on:
pull_request:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR
name: PR Open

on:
pull_request:
Expand Down Expand Up @@ -80,4 +80,5 @@ jobs:
uses: ./.github/workflows/dev.yml
secrets: inherit
with:
appVersion: ${{ needs.vars.outputs.pr }}
tag: ${{ needs.vars.outputs.pr }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
uses: ./.github/workflows/uat.yml
secrets: inherit
with:
appVersion: ${{ needs.vars.outputs.release-name }}
tag: ${{ needs.vars.outputs.pr }}

promote-images-uat:
Expand All @@ -82,6 +83,7 @@ jobs:
uses: ./.github/workflows/prod.yml
secrets: inherit
with:
appVersion: ${{ needs.vars.outputs.release-name }}
tag: ${{ needs.vars.outputs.pr }}

promote-images-prod:
Expand Down
28 changes: 19 additions & 9 deletions charts/onroutebc/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
global:
appVersion: "" # The release version of the application
autoscaling: true
license: "c28f0c"
podAnnotations: |
Expand Down Expand Up @@ -34,7 +35,6 @@ frontend:
ACCESS_API_URL: "https://{{.Release.Name}}-vehicles.apps.silver.devops.gov.bc.ca"
POLICY_URL: "https://{{.Release.Name}}-policy.apps.silver.devops.gov.bc.ca"
DEPLOY_ENVIRONMENT: "{{.Values.global.vault.zone}}"
FRONTEND_PR_NUM: "{{.Values.global.pr_num}}"
config.js.template: |-
const envConfig = (() => { return {
"VITE_DEPLOY_ENVIRONMENT":"$DEPLOY_ENVIRONMENT",
Expand Down Expand Up @@ -64,11 +64,13 @@ frontend:
key: POLICY_URL
- name: DEPLOY_ENVIRONMENT
key: DEPLOY_ENVIRONMENT
- name: FRONTEND_PR_NUM
key: FRONTEND_PR_NUM
fromValues:
- name: TIMESTAMP
value: "{{ now | toString }}"
- name: FRONTEND_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: APPLICATION_VERSION
value: "{{.Values.global.appVersion}}"
ports:
- name: http
containerPort: 3000
Expand Down Expand Up @@ -205,6 +207,8 @@ vehicles:
value: "{{ now | toString }}"
- name: VEHICLES_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: APPLICATION_VERSION
value: "{{.Values.global.appVersion}}"
ports:
- name: vehicles-api
containerPort: 5000
Expand Down Expand Up @@ -340,10 +344,12 @@ dops:
- name: ACCESS_API_URL
key: ACCESS_API_URL
fromValues:
- name: DOPS_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: TIMESTAMP
value: "{{ now | toString }}"
- name: DOPS_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: APPLICATION_VERSION
value: "{{.Values.global.appVersion}}"
ports:
- name: dops-api
containerPort: 5001
Expand Down Expand Up @@ -474,10 +480,12 @@ scheduler:
- name: ACCESS_API_URL
key: ACCESS_API_URL
fromValues:
- name: SCHEDULER_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: TIMESTAMP
value: "{{ now | toString }}"
- name: SCHEDULER_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: APPLICATION_VERSION
value: "{{.Values.global.appVersion}}"
ports:
- name: scheduler
containerPort: 5050
Expand Down Expand Up @@ -576,10 +584,12 @@ policy:
tag: "{{tpl .Values.global.tag .}}"
env:
fromValues:
- name: POLICY_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: TIMESTAMP
value: "{{ now | toString }}"
- name: POLICY_PR_NUM
value: '{{.Values.global.pr_num}}'
- name: APPLICATION_VERSION
value: "{{.Values.global.appVersion}}"
ports:
- name: policy-api
containerPort: 5002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@
<collectionProp name="Arguments.arguments">
<elementProp name="FRONTEND_API_URL" elementType="Argument">
<stringProp name="Argument.name">FRONTEND_API_URL</stringProp>
<stringProp name="Argument.value">onroutebc-test-frontend.apps.silver.devops.gov.bc.ca/</stringProp>
<stringProp name="Argument.value">${FRONTEND_API_URL}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="VEHICLES_API_URL" elementType="Argument">
<stringProp name="Argument.name">VEHICLES_API_URL</stringProp>
<stringProp name="Argument.value">onroutebc-test-vehicles.apps.silver.devops.gov.bc.ca/</stringProp>
<stringProp name="Argument.value">${VEHICLES_API_URL}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="DOPS_API_URL" elementType="Argument">
<stringProp name="Argument.name">DOPS_API_URL</stringProp>
<stringProp name="Argument.value">onroutebc-test-dops.apps.silver.devops.gov.bc.ca/</stringProp>
<stringProp name="Argument.value">${DOPS_API_URL}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="BEARER_TOKEN" elementType="Argument">
Expand Down Expand Up @@ -2753,7 +2753,7 @@
<hashTree/>
</hashTree>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="BCeID update permit" enabled="false">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="BCeID update permit" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
Expand Down Expand Up @@ -5422,7 +5422,7 @@
<hashTree/>
</hashTree>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="BCeID submit permit" enabled="false">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="BCeID submit permit" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
Expand Down Expand Up @@ -7706,7 +7706,7 @@
<hashTree/>
</hashTree>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="IDIR ppc retrived permit pdf" enabled="false">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="IDIR ppc retrived permit pdf" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
Expand Down Expand Up @@ -10055,7 +10055,7 @@
<hashTree/>
</hashTree>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="IDIR ppc create and download pdf" enabled="false">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="IDIR ppc create and download pdf" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
Expand Down
Loading