-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking pull request to merge release-1.17.0 to main (#494)
- Loading branch information
1 parent
edeacee
commit 2078e46
Showing
70 changed files
with
2,128 additions
and
1,584 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 |
---|---|---|
@@ -1,20 +1,34 @@ | ||
|
||
# TFRS Post Release Work | ||
# ITVR Post Release Work | ||
After the release is deployed on Prod | ||
* Merge the tracking pull request to master | ||
* Create the release from master amd make it as the lasted release | ||
* Create the new release branch from master | ||
* Update the following fields in various files | ||
* Update the following fields .github/workflows/build-release.yaml | ||
* name | ||
* branches | ||
* PR_NUMBER | ||
* RELEASE_NAME | ||
* Update .pipeline/lib/config.js | ||
* const version | ||
* Update frontend/package.json | ||
* version | ||
* Create the tracking pull request to merge the new release branch to master | ||
|
||
## Update .github/workflows/tfrs-release.yaml | ||
* name | ||
* branches | ||
* PR_NUMBER | ||
* RELEASE_NAME | ||
# Pre-required Secrets before running the pipeline | ||
itvr-keycloak | ||
itvr-django-secret | ||
itvr-django-salt | ||
itvr-email-service | ||
itvr-patroni-app | ||
itvr-patroni-admin | ||
itvr-object-storage | ||
itvr-ncda | ||
itvr-db-backup-s3 | ||
|
||
## Update .pipeline/lib/config.js | ||
* const version | ||
# Pre-required Image Streams before running the pipeline | ||
itvr-frontend | ||
itvr-backend | ||
itvr-task-queue | ||
|
||
## Update frontend/package.json | ||
* version | ||
tbd |
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
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: PR Build Template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
pr-number: | ||
required: true | ||
type: string | ||
build-suffix: | ||
required: true | ||
type: string | ||
build-image-tag-name: | ||
required: true | ||
type: string | ||
secrets: | ||
tools-namespace: | ||
required: true | ||
openshift-server: | ||
required: true | ||
openshift-token: | ||
required: true | ||
|
||
env: | ||
GIT_URL: https://github.com/bcgov/itvr.git | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
name: Build itvr on Openshift | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: refs/pull/${{ inputs.pr-number }}/head | ||
|
||
- 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: ${{ secrets.tools-namespace }} | ||
|
||
- name: Build itvr Backend | ||
run: | | ||
cd openshift/templates/backend | ||
oc process -f ./backend-bc.yaml NAME=itvr SUFFIX=${{ inputs.build-suffix }} VERSION=${{ inputs.build-image-tag-name }} GIT_URL=${{ env.GIT_URL }} GIT_REF=refs/pull/${{ inputs.pr-number }}/head | oc apply --wait=true -f - -n ${{ secrets.tools-namespace }} | ||
oc cancel-build bc/itvr-backend${{ inputs.build-suffix }} | ||
oc start-build --wait=true itvr-backend${{ inputs.build-suffix }} | ||
- name: Build itvr Frontend | ||
run: | | ||
cd openshift/templates/frontend | ||
oc process -f ./frontend-bc-docker.yaml NAME=itvr SUFFIX=${{ inputs.build-suffix }} VERSION=${{ inputs.build-image-tag-name }} GIT_URL=${{ env.GIT_URL }} GIT_REF=refs/pull/${{ inputs.pr-number }}/head | oc apply --wait=true -f - -n ${{ secrets.tools-namespace }} | ||
oc cancel-build bc/itvr-frontend${{ inputs.build-suffix }} | ||
oc start-build --wait=true itvr-frontend${{ inputs.build-suffix }} | ||
- name: Build itvr task queue | ||
run: | | ||
cd openshift/templates/task-queue | ||
oc process -f ./task-queue-bc.yaml NAME=itvr SUFFIX=${{ inputs.build-suffix }} VERSION=${{ inputs.build-image-tag-name }} GIT_URL=${{ env.GIT_URL }} GIT_REF=refs/pull/${{ inputs.pr-number }}/head | oc apply --wait=true -f - -n ${{ secrets.tools-namespace }} | ||
oc cancel-build bc/itvr-task-queue${{ inputs.build-suffix }} | ||
oc start-build --wait=true itvr-task-queue${{ inputs.build-suffix }} | ||
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 |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: PR Deploy Template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
pr-number: | ||
required: true | ||
type: string | ||
# suffix is in format of -dev-487, -dev, -test, -prod | ||
suffix: | ||
required: true | ||
type: string | ||
# build-image-tag-name is in format of build-release-1.17.0-487 | ||
build-image-tag-name: | ||
required: true | ||
type: string | ||
# image-tag-name is in format of dev-release-1.17.0-487, test-release-1.17.0-487, prod-release-1.17.0-487 | ||
image-tag-name: | ||
required: true | ||
type: string | ||
# env-name is in format of dev, test, prod | ||
env-name: | ||
required: true | ||
type: string | ||
# sample host name itvr-dev.apps.silver.devops.gov.bc.ca, itvr-dev-494.apps.silver.devops.gov.bc.ca | ||
frontend-route-host-name: | ||
required: true | ||
type: string | ||
secrets: | ||
tools-namespace: | ||
required: true | ||
namespace: | ||
required: true | ||
openshift-server: | ||
required: true | ||
openshift-token: | ||
required: true | ||
|
||
jobs: | ||
|
||
deploy: | ||
|
||
name: Deploy itvr | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: refs/pull/${{ inputs.pr-number }}/head | ||
|
||
- 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: ${{ secrets.tools-namespace }} | ||
|
||
- name: Tag Images from tools | ||
run: | | ||
oc tag ${{ secrets.tools-namespace }}/itvr-frontend:${{ inputs.build-image-tag-name }} ${{ secrets.namespace }}/itvr-frontend:${{ inputs.image-tag-name }} | ||
oc tag ${{ secrets.tools-namespace }}/itvr-backend:${{ inputs.build-image-tag-name }} ${{ secrets.namespace }}/itvr-backend:${{ inputs.image-tag-name }} | ||
oc tag ${{ secrets.tools-namespace }}/itvr-task-queue:${{ inputs.build-image-tag-name }} ${{ secrets.namespace }}/itvr-task-queue:${{ inputs.image-tag-name }} | ||
- name: Deploy itvr-frontend | ||
shell: bash {0} | ||
run: | | ||
cd chart/itvr-apps/charts/itvr-frontend | ||
helm status -n ${{ secrets.namespace }} itvr-frontend${{ inputs.suffix }} | ||
if [ $? -eq 0 ]; then | ||
echo "itvr-frontend${{ inputs.suffix }} release exists already" | ||
helm upgrade \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set frontendImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set envName=${{ inputs.env-name }} \ | ||
--set frontendRouteHostName=${{ inputs.frontend-route-host-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-frontend${{ inputs.suffix }} . | ||
else | ||
echo "itvr-frontend${{ inputs.suffix }} release does not exist" | ||
helm install \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set frontendImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set envName=${{ inputs.env-name }} \ | ||
--set frontendRouteHostName=${{ inputs.frontend-route-host-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-frontend${{ inputs.suffix }} . | ||
fi | ||
- name: Deploy itvr-backend | ||
shell: bash {0} | ||
run: | | ||
cd chart/itvr-apps/charts/itvr-backend | ||
helm status -n ${{ secrets.namespace }} itvr-backend${{ inputs.suffix }} | ||
if [ $? -eq 0 ]; then | ||
echo "itvr-backend${{ inputs.suffix }} release exists already" | ||
helm upgrade \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set backendImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set frontendRouteHostName=${{ inputs.frontend-route-host-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-backend${{ inputs.suffix }} . | ||
else | ||
echo "itvr-backend${{ inputs.suffix }} release does not exist" | ||
helm install \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set backendImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set frontendRouteHostName=${{ inputs.frontend-route-host-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-backend${{ inputs.suffix }} . | ||
fi | ||
- name: Deploy itvr-task-queue | ||
shell: bash {0} | ||
run: | | ||
cd chart/itvr-apps/charts/itvr-task-queue | ||
helm status -n ${{ secrets.namespace }} itvr-task-queue${{ inputs.suffix }} | ||
if [ $? -eq 0 ]; then | ||
echo "itvr-task-queue${{ inputs.suffix }} release exists already" | ||
helm upgrade \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set taskQueueImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set envName=${{ inputs.env-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-task-queue${{ inputs.suffix }} . | ||
else | ||
echo "itvr-task-queue${{ inputs.suffix }} release does not exist" | ||
helm install \ | ||
--set namespace=${{ secrets.namespace }} \ | ||
--set taskQueueImageTagName=${{ inputs.image-tag-name }} \ | ||
--set suffix=${{ inputs.suffix }} \ | ||
--set envName=${{ inputs.env-name }} \ | ||
-n ${{ secrets.namespace }} -f ./values-${{ inputs.env-name }}.yaml itvr-task-queue${{ inputs.suffix }} . | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Please refer to ./readme.md for how to build single pull request | ||
|
||
# Update this workflow name per pull request | ||
name: PR Dev CICD | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, edited, reopened] | ||
branches: | ||
- 'release-*' | ||
|
||
jobs: | ||
|
||
# call-unit-test: | ||
# uses: ./.github/workflows/unit-test-template.yaml | ||
# with: | ||
# pr-number: ${{ github.event.pull_request.number }} | ||
|
||
call-pr-build-template: | ||
if: endsWith( github.event.pull_request.title, 'build-on-dev' ) | ||
# needs: call-unit-test | ||
uses: ./.github/workflows/pr-build-template.yaml | ||
with: | ||
pr-number: ${{ github.event.pull_request.number }} | ||
build-suffix: -build-${{ github.event.pull_request.number }} | ||
build-image-tag-name: build-${{ github.event.pull_request.base.ref }}-${{ github.event.pull_request.number }} | ||
secrets: | ||
tools-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
openshift-server: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
|
||
call-pr-dev-database-template: | ||
if: endsWith( github.event.pull_request.title, 'build-on-dev' ) | ||
uses: ./.github/workflows/pr-dev-database-template.yaml | ||
with: | ||
pr-number: ${{ github.event.pull_request.number }} | ||
dev-suffix: -dev-${{ github.event.pull_request.number }} | ||
secrets: | ||
dev-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-dev | ||
itvr-dev-username: ${{ secrets.ITVR_DEV_USERNAME }} | ||
itvr-dev-password: ${{ secrets.ITVR_DEV_PASSWORD }} | ||
openshift-server: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
|
||
call-pr-deploy-template: | ||
if: endsWith( github.event.pull_request.title, 'build-on-dev' ) | ||
needs: [call-pr-build-template, call-pr-dev-database-template] | ||
uses: ./.github/workflows/pr-deploy-template.yaml | ||
with: | ||
pr-number: ${{ github.event.pull_request.number }} | ||
suffix: -dev-${{ github.event.pull_request.number }} | ||
build-image-tag-name: build-${{ github.event.pull_request.base.ref }}-${{ github.event.pull_request.number }} | ||
image-tag-name: dev-${{ github.event.pull_request.base.ref }}-${{ github.event.pull_request.number }} | ||
env-name: dev | ||
frontend-route-host-name: itvr-dev-${{ github.event.pull_request.number }}.apps.silver.devops.gov.bc.ca | ||
secrets: | ||
tools-namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-dev | ||
openshift-server: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift-token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
|
Oops, something went wrong.