diff --git a/.github/workflows/ci-cd-pims-dev.yml b/.github/workflows/ci-cd-pims-dev.yml index a0d79c4e0e..62c26e09f5 100644 --- a/.github/workflows/ci-cd-pims-dev.yml +++ b/.github/workflows/ci-cd-pims-dev.yml @@ -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 @@ -98,10 +102,55 @@ 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 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: Setup .NET 6 + uses: actions/setup-dotnet@v1 + 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 diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 402d7b1fda..3d23906a36 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -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 }} diff --git a/.github/workflows/keycloak-sync.yml b/.github/workflows/keycloak-sync.yml deleted file mode 100644 index 7d515e376f..0000000000 --- a/.github/workflows/keycloak-sync.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Keycloak Sync -env: - AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET }} - AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }} - sync-directory: ./tools/keycloak/sync - ASPNETCORE_ENVIRONMENT: ${{ inputs.TARGET_BRANCH }} - -on: - workflow_dispatch: - inputs: - TARGET_BRANCH: - description: "Enter the target branch (dev/test)" - required: true - -jobs: - sync-backend: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.TARGET_BRANCH }} - - - name: Set ASPNETCORE_ENVIRONMENT (dev) - if: ${{ inputs.TARGET_BRANCH == 'dev' }} - run: echo "ASPNETCORE_ENVIRONMENT=development" >> $GITHUB_ENV - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - 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}} diff --git a/.github/workflows/retag-dev-to-test.yml b/.github/workflows/retag-dev-to-test.yml index ec29268fe5..c0b3982b8f 100644 --- a/.github/workflows/retag-dev-to-test.yml +++ b/.github/workflows/retag-dev-to-test.yml @@ -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: "Test" ## variables for scripts under git\openshift\4.0\scripts\oc-*.sh APP_PORT: 8080 @@ -60,6 +64,28 @@ jobs: ./openshift/4.0/player.sh deploy api $DESTINATION -apply ./openshift/4.0/player.sh deploy app $DESTINATION -apply + sync-keycloak: + name: Sync Keycloak + needs: deploy + runs-on: ubuntu-latest + steps: + - name: Setup .NET 6 + uses: actions/setup-dotnet@v1 + 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 diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj index 23531e9a04..ef23aafbec 100644 --- a/source/backend/api/Pims.Api.csproj +++ b/source/backend/api/Pims.Api.csproj @@ -2,8 +2,8 @@ 0ef6255f-9ea0-49ec-8c65-c172304b4926 - 4.0.0-64.8 - 4.0.0-64.8 + 4.0.0-64.9 + 4.0.0-64.9 4.0.0.64 true 16BC0468-78F6-4C91-87DA-7403C919E646 diff --git a/source/frontend/package.json b/source/frontend/package.json index 2a6b756719..3cbf002ce8 100644 --- a/source/frontend/package.json +++ b/source/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "4.0.0-64.8", + "version": "4.0.0-64.9", "private": true, "dependencies": { "@bcgov/bc-sans": "1.0.1", diff --git a/testing/PIMS.Tests.Automation/Data/ExcelDataContext.cs b/testing/PIMS.Tests.Automation/Data/ExcelDataContext.cs index dec24ae006..783ae48079 100644 --- a/testing/PIMS.Tests.Automation/Data/ExcelDataContext.cs +++ b/testing/PIMS.Tests.Automation/Data/ExcelDataContext.cs @@ -14,7 +14,7 @@ public class ExcelDataContext private ExcelDataContext() { - FileStream stream = File.Open(".\\Data\\PIMS_Testing_Data.xlsx", FileMode.Open, FileAccess.Read); + FileStream stream = File.Open(Path.Combine("Data", "PIMS_Testing_Data.xlsx"), FileMode.Open, FileAccess.Read); System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); diff --git a/testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj b/testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj index fa49bda8d2..883614b416 100644 --- a/testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj +++ b/testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj @@ -7,6 +7,12 @@ 484766ab-9711-4242-858c-ae7c826b3074 + + + Always + + + @@ -17,7 +23,7 @@ - + @@ -30,13 +36,13 @@ - - PreserveNewest - + - + + Always +