Skip to content

Commit

Permalink
Merge branch 'dev' into features/psp-6930
Browse files Browse the repository at this point in the history
  • Loading branch information
FuriousLlama authored Oct 6, 2023
2 parents 7654609 + 431609d commit f094b5c
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 54 deletions.
51 changes: 50 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,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
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.

26 changes: 26 additions & 0 deletions .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 }}
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,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
Expand Down
4 changes: 2 additions & 2 deletions source/backend/api/Pims.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<UserSecretsId>0ef6255f-9ea0-49ec-8c65-c172304b4926</UserSecretsId>
<Version>4.0.0-64.8</Version>
<Version>4.0.0-64.8</Version>
<Version>4.0.0-64.9</Version>
<Version>4.0.0-64.9</Version>
<AssemblyVersion>4.0.0.64</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectGuid>16BC0468-78F6-4C91-87DA-7403C919E646</ProjectGuid>
Expand Down
2 changes: 1 addition & 1 deletion source/frontend/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion testing/PIMS.Tests.Automation/Data/ExcelDataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
16 changes: 11 additions & 5 deletions testing/PIMS.Tests.Automation/PIMS.Tests.Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<UserSecretsId>484766ab-9711-4242-858c-ae7c826b3074</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<Content Include="Data\PIMS_Testing_Data.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNetEnv" Version="2.5.0" />
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
Expand All @@ -17,7 +23,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Selenium.Support" Version="4.10.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="115.0.5790.9800" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="117.0.5938.9200" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="SpecFlow.xUnit" Version="3.9.74" />
Expand All @@ -30,13 +36,13 @@
</ItemGroup>

<ItemGroup>
<None Update="Data\PIMS_Testing_Data.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Folder Include="TestDocuments\" />
</ItemGroup>

<ItemGroup>
<Folder Include="TestDocuments\" />
<Compile Update="Data\ExcelDataContext.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
</ItemGroup>

</Project>

0 comments on commit f094b5c

Please sign in to comment.