From 5498b79851ce173f430fbd160723896757d42b7e Mon Sep 17 00:00:00 2001 From: Mohaimen Hasan Date: Sun, 15 Nov 2026 15:03:39 +0600 Subject: [PATCH] version --- HRM.UI/ClientApp/src/version.json | 4 ++-- HRM.UI/appsettings.json | 4 ++-- deploy.ps1 | 38 ++++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/HRM.UI/ClientApp/src/version.json b/HRM.UI/ClientApp/src/version.json index c8da96b..bc92988 100644 --- a/HRM.UI/ClientApp/src/version.json +++ b/HRM.UI/ClientApp/src/version.json @@ -1,4 +1,4 @@ { - "version": "20261108-01", - "buildTime": "2026-11-08T05:31:24.9714459Z" + "version": "20261115-03", + "buildTime": "2026-11-15T08:30:42.0805569Z" } diff --git a/HRM.UI/appsettings.json b/HRM.UI/appsettings.json index 607abe1..620a8f4 100644 --- a/HRM.UI/appsettings.json +++ b/HRM.UI/appsettings.json @@ -52,8 +52,8 @@ //"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", //"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development - "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", - "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development + "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBUATBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", + "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBUATBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development }, "Calendar": { diff --git a/deploy.ps1 b/deploy.ps1 index a399b6c..0c54819 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -11,7 +11,7 @@ # Update these values for each client/environment before running $baseHref = "/CELHRM_Master/" -$outputFolder = "publish\CELHRM_Master" # relative to this script's folder (repo root) +$outputFolder = "publish\CELHRM_Master" # relative to this script's folder (repo root); the version is added: CELHRM_Master_ # These never change $repoRoot = $PSScriptRoot @@ -48,6 +48,10 @@ $newCounter = $lastCounter + 1 $version = "$today-" + $newCounter.ToString("D2") # D2 = always 2 digits (01, 02, 03...) $buildTime = (Get-Date).ToUniversalTime().ToString("o") +# Output folder carries the version: e.g. publish\CELHRM_Master_20260517-01 +$destinationPath = Join-Path $repoRoot ($outputFolder + "_" + $version) +$wwwrootPath = Join-Path $destinationPath "wwwroot" + Write-Host "" Write-Host "============================================" -ForegroundColor Cyan Write-Host " CEL HRM - Full Build & Deploy Script" -ForegroundColor Cyan @@ -132,6 +136,26 @@ Copy-Item -Path $distPath -Destination $wwwrootPath -Recurse -Force Write-Host "[OK] Angular files copied to: $wwwrootPath" -ForegroundColor Green +# ---- STEP 5b: Copy everything in HRM.UI\RDLC into the published RDLC folder ---- # +# dotnet publish only copies the RDLC files the csproj lists, so a report (or an +# image it uses) can be missing on the server. Copy the whole folder as it is in +# the repo, overwriting what publish already put there. + +$rdlcSourcePath = Join-Path $repoRoot "HRM.UI\RDLC" +$rdlcDestinationPath = Join-Path $destinationPath "RDLC" + +if (Test-Path $rdlcSourcePath) { + if (-not (Test-Path $rdlcDestinationPath)) { + New-Item -ItemType Directory -Path $rdlcDestinationPath -Force | Out-Null + } + Copy-Item -Path (Join-Path $rdlcSourcePath "*") -Destination $rdlcDestinationPath -Recurse -Force + $rdlcCount = (Get-ChildItem -Path $rdlcDestinationPath -Recurse -File).Count + Write-Host "[OK] RDLC folder copied to: $rdlcDestinationPath ($rdlcCount files)" -ForegroundColor Green +} else { + Write-Host "[WARN] RDLC folder not found: $rdlcSourcePath (skipped)" -ForegroundColor Yellow +} + + # ---- STEP 6: Write Angular web.config to wwwroot ---- # # This is separate from the backend web.config that dotnet publish # already generated at the root of $destinationPath (for the IIS @@ -200,6 +224,18 @@ $angularWebConfig | Out-File -FilePath "$wwwrootPath\web.config" -Encoding utf8 Write-Host "[OK] Angular web.config written to: $wwwrootPath\web.config" -ForegroundColor Green +# ---- STEP 7: Remove the backend web.config from the version folder ---- # +# The server keeps its own web.config (hosting settings per client), so the one +# dotnet publish generated at the folder root must not overwrite it on deploy. +# Only the root file is removed; wwwroot\web.config (Angular, STEP 6) stays. + +$rootWebConfig = Join-Path $destinationPath "web.config" +if (Test-Path $rootWebConfig) { + Remove-Item -Path $rootWebConfig -Force + Write-Host "[OK] Removed web.config from: $destinationPath" -ForegroundColor Green +} + + # ---- DONE ---- # Write-Host "" Write-Host "============================================" -ForegroundColor Cyan