@@ -26,38 +26,17 @@ RUN Invoke-WebRequest -Uri 'https://github.com/LocalGovIMS/localgov-ims/archive/
2626# Restore NuGet packages (all from nuget.org — no GitHub Packages needed)
2727RUN nuget restore src\L ocalGovIms.sln
2828
29- # Build and publish : solution build compiles with Live config (maps to Release for libs).
30- # DeployOnBuild publishes each web project. We publish three times with different publishUrl
31- # to get separate output directories. Each publish overwrites _shared but we copy immediately .
29+ # Build and package : solution build with DeployOnBuild creates PackageTmp directories
30+ # under each web project's obj/Live/Package/PackageTmp with the correct published output.
31+ # We then copy from those per-project directories to separate build output dirs .
3232RUN msbuild src\L ocalGovIms.sln /p:Configuration=Live /p:DeployOnBuild=true `
33- /p:WebPublishMethod=FileSystem /p:publishUrl=C:\b uild\_ shared /verbosity:minimal ; `
34- Copy-Item -Path C:\b uild\_ shared -Destination C:\b uild\p ortal -Recurse -Force ; `
35- Write-Host "Portal snapshot taken"
36-
37- # The solution publish puts all web projects into _shared (last one wins). We need to
38- # identify each project's output. Since all three share the same _shared dir, we use
39- # the WAP (Web Application Project) _PackageTempDir which is created during publish.
40- # Actually, let's just use the obj/Live/Package/PackageTmp directories that MSBuild creates.
41- RUN if (Test-Path 'src\P aymentPortal\o bj\L ive\P ackage\P ackageTmp' ) { `
42- Copy-Item -Path 'src\P aymentPortal\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\p ortal -Recurse -Force ; `
43- Write-Host "Portal from PackageTmp" `
44- } ; `
45- if (Test-Path 'src\A dmin\o bj\L ive\P ackage\P ackageTmp' ) { `
46- Copy-Item -Path 'src\A dmin\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\a dmin -Recurse -Force ; `
47- Write-Host "Admin from PackageTmp" `
48- } else { `
49- New-Item -ItemType Directory -Force C:\b uild\a dmin | Out-Null ; `
50- Copy-Item -Path C:\b uild\_ shared\* -Destination C:\b uild\a dmin -Recurse -Force ; `
51- Write-Host "Admin from _shared fallback" `
52- } ; `
53- if (Test-Path 'src\A pi\o bj\L ive\P ackage\P ackageTmp' ) { `
54- Copy-Item -Path 'src\A pi\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\a pi -Recurse -Force ; `
55- Write-Host "Api from PackageTmp" `
56- } else { `
57- New-Item -ItemType Directory -Force C:\b uild\a pi | Out-Null ; `
58- Copy-Item -Path C:\b uild\_ shared\* -Destination C:\b uild\a pi -Recurse -Force ; `
59- Write-Host "Api from _shared fallback" `
60- }
33+ /p:WebPublishMethod=Package /verbosity:minimal
34+
35+ # Copy each web project's PackageTmp output to separate directories for the runtime stage.
36+ RUN New-Item -ItemType Directory -Force -Path C:\b uild\p ortal, C:\b uild\a dmin, C:\b uild\a pi | Out-Null ; `
37+ Copy-Item -Path 'src\P aymentPortal\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\p ortal -Recurse -Force ; `
38+ Copy-Item -Path 'src\A dmin\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\a dmin -Recurse -Force ; `
39+ Copy-Item -Path 'src\A pi\o bj\L ive\P ackage\P ackageTmp\* ' -Destination C:\b uild\a pi -Recurse -Force
6140
6241RUN Write-Host "Portal: $((Get-ChildItem C:\b uild\p ortal -Recurse -File).Count) files" ; `
6342 Write-Host "Admin: $((Get-ChildItem C:\b uild\a dmin -Recurse -File).Count) files" ; `
0 commit comments