Skip to content

Commit

Permalink
Merge pull request #3646 from devinleighsmith/merge_hotfix_to_master
Browse files Browse the repository at this point in the history
Merge R4.1 to master
  • Loading branch information
devinleighsmith authored Dec 11, 2023
2 parents d3680e5 + 2b362d6 commit 897a2c5
Show file tree
Hide file tree
Showing 2,143 changed files with 468,840 additions and 60,827 deletions.
29 changes: 25 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
# These owners will be the default owners for everything in

# the repo. Unless a later match takes precedence,

# @global-owner1 and @global-owner2 will be requested for

# review when someone opens a pull request.
* @devinleighsmith @asanchezr @FuriousLlama @stairaku @PryancaJSharma @eddherrera @buddy326

- @devinleighsmith @asanchezr @FuriousLlama @stairaku @eddherrera @ap-quartech

# Order is important; the last matching pattern takes the most

# precedence. When someone opens a pull request that only

# modifies JS files, only @js-owner and not the global

# owner(s) will be requested for a review.
# *.js @js-owner

# \*.js @js-owner

# You can also use email addresses if you prefer. They'll be

# used to look up users just like we do for commit author

# emails.
# *.go [email protected]

# \*.go [email protected]

# In this example, @doctocat owns any files in the build/logs

# directory at the root of the repository and any of its

# subdirectories.

# /build/logs/ @doctocat

# The `docs/*` pattern will match files like

# `docs/getting-started.md` but not further nested files like

# `docs/build-app/troubleshooting.md`.
# docs/* [email protected]

# docs/\* [email protected]

# In this example, @octocat owns any file in an apps directory

# anywhere in your repository.

# apps/ @octocat

# In this example, @doctocat owns any file in the `/docs`

# directory in the root of your repository.

# /docs/ @doctocat
2 changes: 2 additions & 0 deletions .github/workflows/app-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:

- run: npm run coverage -- --maxWorkers=2
working-directory: ${{env.working-directory}}
env:
REACT_APP_TENANT: MOTI

- name: Codecov
uses: codecov/[email protected]
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/ci-cd-pims-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ env:
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "Development"

## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
APP_PORT: 8080
Expand Down Expand Up @@ -98,10 +102,58 @@ jobs:
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
# 2) greps the generated name from the previous step.
# 3) waits for the job to complete using the generated name.
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: 3cd915-dev
- name: call scripts to upgrade database
shell: bash
run: |
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)
sync-keycloak:
name: Sync Keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"

- name: Install dependencies for keycloak sync
run: dotnet restore
working-directory: ${{env.sync-directory}}

- name: Build keycloak sync
run: dotnet build
working-directory: ${{env.sync-directory}}

- name: Start keycloak sync
run: dotnet run
working-directory: ${{env.sync-directory}}

ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
needs: deploy
needs: sync-keycloak
if: ${{ always() && github.event.pull_request.merged == true }}
steps:
- name: check workflow status
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: smoke test (.NET)
env:
baseUrl: ${{ vars.BASE_URL }}
Base_url: ${{ vars.BASE_URL }}
CloseBrowserAfterEachTest: false
RunHeadless: true
Users__0__User: ${{ secrets.USER_1_USERNAME }}
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/keycloak-sync.yml

This file was deleted.

55 changes: 54 additions & 1 deletion .github/workflows/retag-dev-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ env:
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET_TEST }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "Test"

## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
APP_PORT: 8080
Expand Down Expand Up @@ -60,10 +64,59 @@ jobs:
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
# 2) greps the generated name from the previous step.
# 3) waits for the job to complete using the generated name.
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: 3cd915-dev
- name: call scripts to upgrade database
shell: bash
run: |
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)
sync-keycloak:
name: Sync Keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"

- name: Install dependencies for keycloak sync
run: dotnet restore
working-directory: ${{env.sync-directory}}

- name: Build keycloak sync
run: dotnet build
working-directory: ${{env.sync-directory}}

- name: Start keycloak sync
run: dotnet run
working-directory: ${{env.sync-directory}}

ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
needs: deploy
needs: sync-keycloak
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
Expand Down
129 changes: 129 additions & 0 deletions .github/workflows/retag-test-to-uat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: CI-CD Release Test to UAT
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
# service account: gitaction
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET_UAT }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
sync-directory: ./tools/keycloak/sync

## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
APP_PORT: 8080
DESTINATION: "uat"
OC_JOB_NAME: "uat"
GIT_URL: "${{github.server_url}}/${{github.repository}}"
GIT_BRANCH: "${{github.ref}}"
APP_NAME: "pims"
PROJ_PREFIX: "3cd915"
PROJ_TOOLS: "3cd915-tools"
PROJ_DEV: "dev"
PROJ_TEST: "test"
PROJ_PROD: "prod"
TAG_DEV: "dev"
TAG_TEST: "test"
TAG_PROD: "prod"
INSTANCE: "-uat"
NAMESPACE_OVERRIDE: "3cd915-test"
RELEASE_TAG: "test"

on: workflow_dispatch

jobs:
ci-cd-start-notification:
name: CI-CD Start Notification to Teams Channel
runs-on: ubuntu-latest
steps:
- name: Start notification to Teams Channel
uses: dragos-cojocari/[email protected]
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
notification-summary: PIMS Release DEV to TST Started
notification-color: 17a2b8
timezone: America/Los_Angeles

deploy:
name: Retag/Deploy frontend and api to OpenShift
needs: ci-cd-start-notification
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
- name: call scripts to deploy api and frontend
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
# 2) greps the generated name from the previous step.
# 3) waits for the job to complete using the generated name.
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: 3cd915-test
- name: call scripts to upgrade database
shell: bash
run: |
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -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)
sync-keycloak:
name: Sync Keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"

- name: Install dependencies for keycloak sync
run: dotnet restore
working-directory: ${{env.sync-directory}}

- name: Build keycloak sync
run: dotnet build
working-directory: ${{env.sync-directory}}

- name: Start keycloak sync
run: dotnet run
working-directory: ${{env.sync-directory}}

ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
needs: sync-keycloak
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
id: check
- name: End notification to Teams Channel
uses: dragos-cojocari/[email protected]
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
notification-summary: PIMS Release TEST to UAT COMPLETED with status ${{ steps.check.outputs.status }}
notification-color: 17a2b8
timezone: America/Los_Angeles
Loading

0 comments on commit 897a2c5

Please sign in to comment.