Skip to content

Commit

Permalink
Merge branch 'dev' into features/psp-8573
Browse files Browse the repository at this point in the history
  • Loading branch information
FuriousLlama authored Dec 18, 2024
2 parents c530a70 + 56b6c5e commit 2d5eef0
Show file tree
Hide file tree
Showing 66 changed files with 813 additions and 310 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/api-dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
# JOB to run change detection
check-changes:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Set job outputs to values from filter step
outputs:
backend: ${{ steps.filter.outputs.backend }}
Expand All @@ -24,11 +24,19 @@ jobs:
build-backend:
needs: check-changes
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ needs.check-changes.outputs.backend == 'true' }}
strategy:
matrix:
services: [{directory: ./source/backend/api, solution: 'Pims.sln'}, {directory: ./source/backend/proxy, solution: 'Proxy.sln'}, {directory: ./source/backend/scheduler, solution: 'Scheduler.sln'}]
services:
[
{ directory: ./source/backend/api, solution: "Pims.sln" },
{ directory: ./source/backend/proxy, solution: "Proxy.sln" },
{
directory: ./source/backend/scheduler,
solution: "Scheduler.sln",
},
]
env:
working-directory: ${{ matrix.services.directory }}
solution-name: ${{ matrix.services.solution }}
Expand Down Expand Up @@ -147,7 +155,7 @@ jobs:
sonarHostname: ${{secrets.SONAR_URL}}
post-build:
needs: build-backend
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
working-directory: ./source/backend
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
87 changes: 42 additions & 45 deletions .github/workflows/app-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ on:
pull_request:
branches: [master, test, dev]


jobs:

build:

name: build-logging
if: github.event.ref == 'refs/heads/master' || github.event.ref == 'refs/heads/test' || github.event.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
SLEEP_TIME: 60
STORAGE_TYPE: Amazon_S3
Expand All @@ -32,44 +29,44 @@ jobs:
working-directory: ./openshift/4.0/templates/Logging

steps:
- uses: actions/checkout@v4
- name: Set ENV variable
run: |
if [[ ${{github.event.ref}} == 'refs/heads/test' ]]; then
echo "FRONTEND_APP_NAME=pims-app-test" >> $GITHUB_ENV
echo "API_NAME=pims-api-test" >> $GITHUB_ENV
elif [[ ${{github.event.ref}} == 'refs/heads/master' ]]; then
echo "FRONTEND_APP_NAME=pims-app-uat" >> $GITHUB_ENV
echo "API_NAME=pims-api-uat" >> $GITHUB_ENV
echo "PROJECT_NAMESPACE=3cd915-test" >> $GITHUB_ENV
else
echo "FRONTEND_APP_NAME=pims-app" >> $GITHUB_ENV
echo "API_NAME=pims-api" >> $GITHUB_ENV
fi
- name: Build the pims-logging docker-compose stack
run: docker-compose -f docker-compose.yml up -d
working-directory: ${{env.working-directory}}
- name: Sleep for 180 seconds
uses: jakejarvis/wait-action@master
with:
time: '180s'
- name: Check Extracted Logs
run: |
docker cp pims-logging:/logging/. .
exitcode=$(docker inspect pims-logging --format='{{.State.ExitCode}}')
if [[ "$(ls -A pims* 2>/dev/null | wc -l)" != "0" ]]; then
ls -A pims* && rm -f pims*
elif [[ $exitcode == 0 ]]; then
echo "Info: No log captured between sleep time"
else
echo "There's an error capturing pims logs" && exit 1
fi
- name: Check running containers
run: docker ps -a
- name: Check pims-logging logs
if: always()
run: docker logs pims-logging
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
working-directory: ${{env.working-directory}}
- uses: actions/checkout@v4
- name: Set ENV variable
run: |
if [[ ${{github.event.ref}} == 'refs/heads/test' ]]; then
echo "FRONTEND_APP_NAME=pims-app-test" >> $GITHUB_ENV
echo "API_NAME=pims-api-test" >> $GITHUB_ENV
elif [[ ${{github.event.ref}} == 'refs/heads/master' ]]; then
echo "FRONTEND_APP_NAME=pims-app-uat" >> $GITHUB_ENV
echo "API_NAME=pims-api-uat" >> $GITHUB_ENV
echo "PROJECT_NAMESPACE=3cd915-test" >> $GITHUB_ENV
else
echo "FRONTEND_APP_NAME=pims-app" >> $GITHUB_ENV
echo "API_NAME=pims-api" >> $GITHUB_ENV
fi
- name: Build the pims-logging docker-compose stack
run: docker-compose -f docker-compose.yml up -d
working-directory: ${{env.working-directory}}
- name: Sleep for 180 seconds
uses: jakejarvis/wait-action@master
with:
time: "180s"
- name: Check Extracted Logs
run: |
docker cp pims-logging:/logging/. .
exitcode=$(docker inspect pims-logging --format='{{.State.ExitCode}}')
if [[ "$(ls -A pims* 2>/dev/null | wc -l)" != "0" ]]; then
ls -A pims* && rm -f pims*
elif [[ $exitcode == 0 ]]; then
echo "Info: No log captured between sleep time"
else
echo "There's an error capturing pims logs" && exit 1
fi
- name: Check running containers
run: docker ps -a
- name: Check pims-logging logs
if: always()
run: docker logs pims-logging
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
working-directory: ${{env.working-directory}}
4 changes: 2 additions & 2 deletions .github/workflows/app-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
# JOB to run change detection
check-changes:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Set job outputs to values from filter step
outputs:
frontend: ${{ steps.filter.outputs.frontend }}
Expand All @@ -25,7 +25,7 @@ jobs:
build-frontend:
needs: check-changes
if: ${{ needs.check-changes.outputs.frontend == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
CI: true
working-directory: ./source/frontend
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci-cd-pims-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
jobs:
ci-cd-start-notification:
name: CI-CD Start Notification to Teams Channel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Start notification to Teams Channel
uses: dragos-cojocari/[email protected]
Expand All @@ -46,7 +46,7 @@ jobs:
build-frontend:
name: Build frontend
needs: ci-cd-start-notification
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -65,7 +65,7 @@ jobs:
build-api:
name: Build api
needs: ci-cd-start-notification
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -85,7 +85,7 @@ jobs:
deploy:
name: Deploy to OpenShift
needs: [build-frontend, build-api]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -155,7 +155,7 @@ jobs:
mayan-sync:
name: sync mayan
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -177,7 +177,7 @@ jobs:
keycloak-sync:
name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -195,7 +195,7 @@ jobs:
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: keycloak-sync
steps:
- name: check workflow status
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov-comment-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
upload:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/credentials-comment-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
# this action will leave a comment in response to credential scans performed on pull requests
on-completed:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.event.workflow_run.event == 'pull_request'
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/credentials-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
credentials-scan:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/db-schma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:
name: db-schema
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-prod-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
maintenance-page:
name: Hide the maintenance page
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: maintenance-page
steps:
- name: check workflow status
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-prod-start-argo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
jobs:
ci-cd-start-notification:
name: CI-CD Start Notification to Teams Channel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Start notification to Teams Channel
uses: dragos-cojocari/[email protected]
Expand All @@ -48,7 +48,7 @@ jobs:

deploy:
name: Deploy frontend and api to OpenShift
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: ci-cd-start-notification
steps:
- name: Checkout Source Code
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -117,7 +117,7 @@ jobs:
mayan-sync:
name: sync mayan
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -139,7 +139,7 @@ jobs:
keycloak-sync:
name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/deploy-prod-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
jobs:
ci-cd-start-notification:
name: CI-CD Start Notification to Teams Channel
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Start notification to Teams Channel
uses: dragos-cojocari/[email protected]
Expand All @@ -47,7 +47,7 @@ jobs:

deploy:
name: Deploy frontend and api to OpenShift
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: ci-cd-start-notification
steps:
- name: Checkout Source Code
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
database-upgrade:
name: Upgrade database
needs: [deploy]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -107,7 +107,7 @@ jobs:
mayan-sync:
name: sync mayan
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -125,11 +125,11 @@ jobs:
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-prod -p TOKEN_URL=https://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-3cd915-prod.apps.silver.devops.gov.bc.ca/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-prod -p TOKEN_URL=https://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-3cd915-prod.apps.silver.devops.gov.bc.ca/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
keycloak-sync:
name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
Expand All @@ -144,4 +144,3 @@ jobs:
shell: bash
run: |
oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=3cd915-prod -p BRANCH=$DESTINATION -p API_URL=http://pims-api:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
Loading

0 comments on commit 2d5eef0

Please sign in to comment.