Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc9de38da3 | |||
| 2694863d07 | |||
| 8646fa83c8 | |||
| 796d084ea6 | |||
| 6d23c63912 | |||
| 3803d16731 | |||
| 29fd7163dc |
Vendored
+49
-1
@@ -24,6 +24,17 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test') {
|
||||
steps {
|
||||
bat 'dotnet test tests\\PowderCoating.UnitTests --no-build -c Release --logger "trx;LogFileName=results.trx" --results-directory TestResults'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit testResults: 'TestResults/*.trx', allowEmptyResults: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Migrations') {
|
||||
steps {
|
||||
bat 'dotnet tool install --global dotnet-ef 2>nul || dotnet tool update --global dotnet-ef 2>nul'
|
||||
@@ -42,7 +53,18 @@ pipeline {
|
||||
|
||||
stage('Deploy to Azure') {
|
||||
steps {
|
||||
bat 'powershell -Command "Add-Type -Assembly System.IO.Compression.FileSystem; if (Test-Path deploy.zip) { Remove-Item deploy.zip }; [System.IO.Compression.ZipFile]::CreateFromDirectory(\'publish\', \'deploy.zip\')"'
|
||||
powershell '''
|
||||
Add-Type -Assembly System.IO.Compression.FileSystem
|
||||
if (Test-Path deploy.zip) { Remove-Item deploy.zip }
|
||||
$publishDir = (Resolve-Path "publish").Path
|
||||
$zip = [System.IO.Compression.ZipFile]::Open("deploy.zip", "Create")
|
||||
Get-ChildItem -Path $publishDir -Recurse -File | ForEach-Object {
|
||||
$entryName = $_.FullName.Substring($publishDir.Length + 1).Replace("\\", "/")
|
||||
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($zip, $_.FullName, $entryName, "Optimal") | Out-Null
|
||||
}
|
||||
$zip.Dispose()
|
||||
Write-Host "deploy.zip created with forward-slash entry paths"
|
||||
'''
|
||||
withCredentials([azureServicePrincipal(
|
||||
credentialsId: 'azure-pcl',
|
||||
subscriptionIdVariable: 'AZ_SUB_ID',
|
||||
@@ -57,6 +79,32 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Health Check') {
|
||||
steps {
|
||||
powershell '''
|
||||
$url = "https://app.powdercoatinglogix.com/"
|
||||
$timeout = 180
|
||||
$elapsed = 0
|
||||
Write-Host "Polling $url for up to $timeout seconds..."
|
||||
do {
|
||||
Start-Sleep -Seconds 10
|
||||
$elapsed += 10
|
||||
try {
|
||||
$r = Invoke-WebRequest $url -UseBasicParsing -TimeoutSec 10
|
||||
if ($r.StatusCode -lt 400) {
|
||||
Write-Host "App responded HTTP $($r.StatusCode) after ${elapsed}s"
|
||||
exit 0
|
||||
}
|
||||
} catch {
|
||||
Write-Host "[${elapsed}s] Not yet responding: $_"
|
||||
}
|
||||
} while ($elapsed -lt $timeout)
|
||||
Write-Error "App did not come healthy within $timeout seconds"
|
||||
exit 1
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
|
||||
@@ -117,7 +117,8 @@ public class AccountBalanceService : IAccountBalanceService
|
||||
/// </summary>
|
||||
private static bool IsNormalDebitBalance(AccountSubType subType) => subType switch
|
||||
{
|
||||
AccountSubType.Checking
|
||||
AccountSubType.Cash
|
||||
or AccountSubType.Checking
|
||||
or AccountSubType.Savings
|
||||
or AccountSubType.AccountsReceivable
|
||||
or AccountSubType.Inventory
|
||||
|
||||
@@ -349,7 +349,8 @@ public class LedgerService : ILedgerService
|
||||
private static bool IsNormalDebitBalance(AccountSubType subType) => subType switch
|
||||
{
|
||||
// Asset subtypes → normal debit balance
|
||||
AccountSubType.Checking
|
||||
AccountSubType.Cash
|
||||
or AccountSubType.Checking
|
||||
or AccountSubType.Savings
|
||||
or AccountSubType.AccountsReceivable
|
||||
or AccountSubType.Inventory
|
||||
|
||||
Reference in New Issue
Block a user