Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 38 additions & 135 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
types: [published]

jobs:
buildlinux:
build:
name: "Release"
env:
ASPNETCORE_ENVIRONMENT: "Production"
Expand All @@ -15,11 +15,6 @@
steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down Expand Up @@ -51,7 +46,7 @@

- name: Publish UI
if: ${{ github.event.release.prerelease == false }}
run: dotnet publish "EstateManagementUI\EstateManagementUI.csproj" --configuration Release --output publishOutput -r linux-x64 --self-contained
run: dotnet publish "EstateManagementUI\EstateManagementUI.csproj" --configuration Release --output publishOutput -r win-x64 --self-contained

- name: Build Release Package
run: |
Expand All @@ -65,159 +60,67 @@
path: estatemanagementui.zip

deploystaging:
runs-on: [stagingserver,linux]
needs: buildlinux
runs-on: [stagingserver,windows]
needs: build
environment: staging
name: "Deploy to Staging"

steps:
- name: Download the artifact
uses: actions/[email protected]
with:
name: estatemanagementui
path: /tmp/estatemanagementui # Download to a temporary directory

- name: Remove existing service (if applicable)
- name: Remove existing Windows service
run: |
SERVICE_NAME="estatemanagementui"
if systemctl is-active --quiet "$SERVICE_NAME"; then
echo "Stopping existing service..."
sudo systemctl stop "$SERVICE_NAME"
fi
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
echo "Disabling existing service..."
sudo systemctl disable "$SERVICE_NAME"
fi
if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then
echo "Removing existing service unit file..."
sudo rm "/etc/systemd/system/${SERVICE_NAME}.service"
sudo systemctl daemon-reload
fi

$serviceName = "Transaction Processing - Estate Management UI"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}

- name: Unzip the files
run: |
sudo mkdir -p /opt/txnproc/transactionprocessing/estatemanagementui
sudo unzip -o /tmp/estatemanagementui/estatemanagementui.zip -d /opt/txnproc/transactionprocessing/estatemanagementui

# IMPORTANT: Add a step to ensure the .NET runtime is installed on the server
# This assumes it's not already there. If your base image already has it, you can skip this.
- name: Install .NET Runtime
run: |
# Example for Ubuntu. Adjust based on your .NET version (e.g., 8.0, 7.0)
# and if you need the SDK or just the runtime.
# This uses Microsoft's package repository for the latest versions.
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt update
sudo apt install -y aspnetcore-runtime-9.0

- name: Install and Start as a Linux service
Expand-Archive -Path estatemanagementui.zip -DestinationPath "C:\txnproc\transactionprocessing\estatemanagementui" -Force

- name: Install as a Windows service
run: |
SERVICE_NAME="estatemanagementui"
# The WorkingDirectory is crucial for .NET apps to find appsettings.json and other files
WORKING_DIRECTORY="/opt/txnproc/transactionprocessing/estatemanagementui"
DLL_NAME="EstateManagementUI.dll" # Your application's DLL
SERVICE_DESCRIPTION="Transaction Processing - Estate Management UI"

# Create a systemd service file
echo "[Unit]" | sudo tee /etc/systemd/system/${SERVICE_NAME}.service
echo "Description=${SERVICE_DESCRIPTION}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "After=network.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "[Service]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
# IMPORTANT: Use 'dotnet' to run your DLL
echo "ExecStart=/usr/bin/dotnet ${WORKING_DIRECTORY}/${DLL_NAME}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "WorkingDirectory=${WORKING_DIRECTORY}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "Restart=always" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "User=youruser" # IMPORTANT: Change to a dedicated, less privileged user
echo "Group=yourgroup" # IMPORTANT: Change to a dedicated, less privileged group
echo "Environment=ASPNETCORE_ENVIRONMENT=Production" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service # Example
echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "[Install]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service

# Reload systemd, enable, and start the service
sudo systemctl daemon-reload
sudo systemctl enable "$SERVICE_NAME"
sudo systemctl start "$SERVICE_NAME"
sudo systemctl status "$SERVICE_NAME" --no-pager # For debugging/verification
$serviceName = "Transaction Processing - Estate Management UI"
$servicePath = "C:\txnproc\transactionprocessing\estatemanagementui\EstateManagementUI.exe"

New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName

deployproduction:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
runs-on: [productionserver,linux]
needs: [buildlinux, deploystaging]
runs-on: [productionserver, windows]
needs: [build, deploystaging]
environment: production
name: "Deploy to Production"

steps:
- name: Download the artifact
uses: actions/[email protected]
with:
name: estatemanagementui
path: /tmp/estatemanagementui # Download to a temporary directory

- name: Remove existing service (if applicable)
- name: Remove existing Windows service
run: |
SERVICE_NAME="estatemanagementui"
if systemctl is-active --quiet "$SERVICE_NAME"; then
echo "Stopping existing service..."
sudo systemctl stop "$SERVICE_NAME"
fi
if systemctl is-enabled --quiet "$SERVICE_NAME"; then
echo "Disabling existing service..."
sudo systemctl disable "$SERVICE_NAME"
fi
if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then
echo "Removing existing service unit file..."
sudo rm "/etc/systemd/system/${SERVICE_NAME}.service"
sudo systemctl daemon-reload
fi

$serviceName = "Transaction Processing - Estate Management UI"
# Check if the service exists
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Stop-Service -Name $serviceName
sc.exe delete $serviceName
}

- name: Unzip the files
run: |
sudo mkdir -p /opt/txnproc/transactionprocessing/estatemanagementui
sudo unzip -o /tmp/estatemanagementui/estatemanagementui.zip -d /opt/txnproc/transactionprocessing/estatemanagementui

# IMPORTANT: Add a step to ensure the .NET runtime is installed on the server
# This assumes it's not already there. If your base image already has it, you can skip this.
- name: Install .NET Runtime
run: |
# Example for Ubuntu. Adjust based on your .NET version (e.g., 8.0, 7.0)
# and if you need the SDK or just the runtime.
# This uses Microsoft's package repository for the latest versions.
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt update
sudo apt install -y aspnetcore-runtime-9.0

- name: Install and Start as a Linux service
Expand-Archive -Path estatemanagementui.zip -DestinationPath "C:\txnproc\transactionprocessing\estatemanagementui" -Force

- name: Install as a Windows service
run: |
SERVICE_NAME="estatemanagementui"
# The WorkingDirectory is crucial for .NET apps to find appsettings.json and other files
WORKING_DIRECTORY="/opt/txnproc/transactionprocessing/estatemanagementui"
DLL_NAME="EstateManagementUI.dll" # Your application's DLL
SERVICE_DESCRIPTION="Transaction Processing - Estate Management UI"

# Create a systemd service file
echo "[Unit]" | sudo tee /etc/systemd/system/${SERVICE_NAME}.service
echo "Description=${SERVICE_DESCRIPTION}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "After=network.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "[Service]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
# IMPORTANT: Use 'dotnet' to run your DLL
echo "ExecStart=/usr/bin/dotnet ${WORKING_DIRECTORY}/${DLL_NAME}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "WorkingDirectory=${WORKING_DIRECTORY}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "Restart=always" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "User=youruser" # IMPORTANT: Change to a dedicated, less privileged user
echo "Group=yourgroup" # IMPORTANT: Change to a dedicated, less privileged group
echo "Environment=ASPNETCORE_ENVIRONMENT=Production" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service # Example
echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "[Install]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service
echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service

# Reload systemd, enable, and start the service
sudo systemctl daemon-reload
sudo systemctl enable "$SERVICE_NAME"
sudo systemctl start "$SERVICE_NAME"
sudo systemctl status "$SERVICE_NAME" --no-pager # For debugging/verification
$serviceName = "Transaction Processing - Estate Management UI"
$servicePath = "C:\txnproc\transactionprocessing\estatemanagementui\EstateManagementUI.exe"

New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic
Start-Service -Name $serviceName
7 changes: 1 addition & 6 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:

steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'


- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'

- name: Restore Nuget Packages
run: dotnet restore EstateManagementUI.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }}

Expand All @@ -45,11 +40,6 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'

- name: Trust Certificate
run: |
sudo apt-get install expect
Expand Down Expand Up @@ -104,11 +94,6 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'

- name: Trust Certificate
run: |
sudo apt-get install expect
Expand Down Expand Up @@ -163,11 +148,6 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Install NET 9
uses: actions/[email protected]
with:
dotnet-version: '9.0.x'

- name: Trust Certificate
run: |
sudo apt-get install expect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DebugType>None</DebugType>
Expand All @@ -11,12 +11,12 @@

<ItemGroup>
<PackageReference Include="Lamar" Version="15.0.1" />
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="MediatR" Version="14.0.0" />
<PackageReference Include="MediatR.Contracts" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FileProcessor.Client" Version="2025.8.2-build99" />
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10">
<PackageReference Include="MediatR" Version="14.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SecurityService.Client" Version="2025.10.1" />
<PackageReference Include="Shared" Version="2025.11.11" />
<PackageReference Include="SecurityService.Client" Version="2025.12.1" />
<PackageReference Include="Shared" Version="2025.12.1" />
<PackageReference Include="SimpleResults" Version="4.0.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<PackageReference Include="EstateReportingAPI.Client" Version="2025.10.2-build92" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.10.2-build261" />
<PackageReference Include="EstateReportingAPI.Client" Version="2025.12.1" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.12.1" />
</ItemGroup>

</Project>
16 changes: 9 additions & 7 deletions EstateManagementUI.IntegrationTests/Common/Hooks.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System.Diagnostics.Contracts;
using System.Drawing;
using Google.Protobuf.Reflection;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Edge;
using OpenQA.Selenium.Firefox;
using Reqnroll;
using Reqnroll.BoDi;
using Shared.IntegrationTesting;
using System.Diagnostics.Contracts;
using System.Drawing;

namespace EstateManagementUI.IntegrationTests.Common
{
Expand Down Expand Up @@ -56,18 +57,19 @@ private async Task<IWebDriver> CreateWebDriver(){
case null:
case "Chrome":
{
ChromeOptions options = new ChromeOptions();

options = options.WithNoSandBox()
Environment.SetEnvironmentVariable("SE_MANAGER", "0");
ChromeOptions options = new();

options = options.WithNoSandBox()
.WithAcceptInsecureCertificate()
.WithDisableDevShmUsage()
.WithDisableExtensions()
.WithDisableGpu()
.WithDisableInfobars()
.WithHeadless(isCi)
.WithWindowSize(1920, 1080);

webDriver = new ChromeDriver(options);
var service = ChromeDriverService.CreateDefaultService("/usr/bin");
webDriver = new ChromeDriver(service, options);

break;
}
Expand Down
Loading
Loading