Skip to content

Commit df7b88a

Browse files
Merge pull request #4264 from bcgov/test
Release 5.4
2 parents 2239ac9 + 6d12f29 commit df7b88a

File tree

1,425 files changed

+308693
-39962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,425 files changed

+308693
-39962
lines changed

.github/workflows/ci-cd-pims-dev.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ jobs:
123123
- name: call scripts to upgrade database
124124
shell: bash
125125
run: |
126-
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_DEV -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
126+
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_DEV -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
127+
oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
128+
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
127129
128130
sync-keycloak:
129131
name: Sync Keycloak

.github/workflows/depoy-prod-start.yml .github/workflows/deploy-prod-start.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
[[ -z ${{github.event.inputs.OVERRIDE_VERSION}} ]] && RELEASE_VERSION=${{steps.previoustag.outputs.tag}}-master || RELEASE_VERSION=${{github.event.inputs.OVERRIDE_VERSION}}-master
7575
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy api $DESTINATION -apply
7676
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy app $DESTINATION -apply
77-
77+
7878
# the command:
7979
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
8080
# 2) greps the generated name from the previous step.
@@ -96,7 +96,9 @@ jobs:
9696
- name: call scripts to upgrade database
9797
shell: bash
9898
run: |
99-
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=master -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_PRD -p NAMESPACE=3cd915-prod | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
99+
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=master -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_PRD -p NAMESPACE=3cd915-prod | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
100+
oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
101+
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
100102
101103
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
102104
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
@@ -144,4 +146,4 @@ jobs:
144146

145147
- name: Start keycloak sync
146148
run: dotnet run
147-
working-directory: ${{env.sync-directory}}
149+
working-directory: ${{env.sync-directory}}

.github/workflows/retag-dev-to-test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ jobs:
8585
- name: call scripts to upgrade database
8686
shell: bash
8787
run: |
88-
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-test -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_TST -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
88+
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-test -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_TST -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
89+
oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
90+
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
8991
9092
9193
sync-keycloak:
@@ -133,8 +135,8 @@ jobs:
133135
run: |
134136
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan/metadatatype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
135137
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
136-
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
137-
138+
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
139+
138140
ci-cd-end-notification:
139141
name: CI-CD End Notification to Teams Channel
140142
runs-on: ubuntu-latest

.github/workflows/retag-test-to-uat.yml

+26-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
run: |
6464
./openshift/4.0/player.sh deploy api $DESTINATION -apply
6565
./openshift/4.0/player.sh deploy app $DESTINATION -apply
66-
66+
6767
# the command:
6868
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
6969
# 2) greps the generated name from the previous step.
@@ -85,7 +85,9 @@ jobs:
8585
- name: call scripts to upgrade database
8686
shell: bash
8787
run: |
88-
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
88+
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
89+
oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
90+
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
8991
9092
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
9193
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
@@ -133,7 +135,28 @@ jobs:
133135

134136
- name: Start keycloak sync
135137
run: dotnet run
136-
working-directory: ${{env.sync-directory}}
138+
working-directory: ${{env.sync-directory}}
139+
140+
tag-release-image:
141+
name: Release Tag
142+
needs: [deploy]
143+
runs-on: ubuntu-latest
144+
steps:
145+
- name: Checkout Source Code
146+
uses: actions/checkout@v3
147+
- name: Login to OpenShift
148+
uses: redhat-actions/oc-login@v1
149+
with:
150+
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
151+
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
152+
insecure_skip_tls_verify: true
153+
namespace: 3cd915-tools
154+
- name: tag uat image such that it can be promoted to prod
155+
shell: bash
156+
run: |
157+
VERSION=$(make version)
158+
oc tag pims-app:uat pims-app:v${VERSION}-master
159+
oc tag pims-api:uat pims-api:v${VERSION}-master
137160
138161
ci-cd-end-notification:
139162
name: CI-CD End Notification to Teams Channel

.github/workflows/uat_hotfix.yml

+21
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,27 @@ jobs:
171171
run: dotnet run
172172
working-directory: ${{env.sync-directory}}
173173

174+
tag-release-image:
175+
name: Release Tag
176+
needs: [deploy]
177+
runs-on: ubuntu-latest
178+
steps:
179+
- name: Checkout Source Code
180+
uses: actions/checkout@v3
181+
- name: Login to OpenShift
182+
uses: redhat-actions/oc-login@v1
183+
with:
184+
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
185+
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
186+
insecure_skip_tls_verify: true
187+
namespace: 3cd915-tools
188+
- name: tag uat image such that it can be promoted to prod
189+
shell: bash
190+
run: |
191+
VERSION=$(make version)
192+
oc tag pims-app:uat pims-app:v${VERSION}-master
193+
oc tag pims-api:uat pims-api:v${VERSION}-master
194+
174195
ci-cd-end-notification:
175196
if: always()
176197
name: CI-CD End Notification to Teams Channel

.github/workflows/uat_pre_release_hotfix.yml

+21
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,27 @@ jobs:
198198
run: dotnet run
199199
working-directory: ${{env.sync-directory}}
200200

201+
tag-release-image:
202+
name: Release Tag
203+
needs: [deploy]
204+
runs-on: ubuntu-latest
205+
steps:
206+
- name: Checkout Source Code
207+
uses: actions/checkout@v3
208+
- name: Login to OpenShift
209+
uses: redhat-actions/oc-login@v1
210+
with:
211+
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
212+
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
213+
insecure_skip_tls_verify: true
214+
namespace: 3cd915-tools
215+
- name: tag uat image such that it can be promoted to prod
216+
shell: bash
217+
run: |
218+
VERSION=$(make version)
219+
oc tag pims-app:uat pims-app:v${VERSION}-master
220+
oc tag pims-api:uat pims-api:v${VERSION}-master
221+
201222
ci-cd-end-notification:
202223
if: always()
203224
name: CI-CD End Notification to Teams Channel

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ clean: ## Removes all local containers, images, volumes, etc
217217
@docker volume rm -f psp-api-db-data
218218

219219
restart-mayan:
220-
@docker-compose --profile mayan up --build -d
220+
@docker-compose --profile mayan up --build --force-recreate -d
221+
222+
mayan-up: ## Calls the docker compose up for the mayan images
223+
@echo "$(P) Create or start mayan-edms system"
224+
@docker-compose --profile mayan up -d
221225

222226
logs: ## Shows logs for running containers (n=service name)
223227
@docker-compose logs -f $(n)
@@ -311,10 +315,6 @@ env: ## Generate env files
311315
@echo "$(P) Generate/Regenerate env files required for application (generated passwords only match if database .env file does not already exist)"
312316
@./tools/cicd/scripts/gen-env-files.sh;
313317

314-
mayan-up: ## Calls the docker compose up for the mayan images
315-
@echo "$(P) Create or start mayan-edms system"
316-
@cd tools/mayan-edms; docker-compose --profile all up -d
317-
318318
generate-tsapi: ## Generates the pims API typescript files
319319
@echo "$(P) Generating pims api Ts files..."
320320
@cd tools/TsModelGenerator; dotnet build; dotnet run;

0 commit comments

Comments
 (0)