1+ # COMMON PATHS
2+
3+ $buildFolder = (Get-Item - Path " ./" - Verbose).FullName
4+ $slnFolder = Join-Path $buildFolder " ../"
5+ $outputFolder = Join-Path $buildFolder " outputs"
6+ $webHostFolder = Join-Path $slnFolder " src/AbpCompanyName.AbpProjectName.Web.Host"
7+ $ngFolder = Join-Path $buildFolder " ../../angular"
8+
9+ # # CLEAR ######################################################################
10+
11+ Remove-Item $outputFolder - Force - Recurse
12+ New-Item - Path $outputFolder - ItemType Directory
13+
14+ # # RESTORE NUGET PACKAGES #####################################################
15+
16+ Set-Location $slnFolder
17+ dotnet restore
18+
19+ # # PUBLISH WEB HOST PROJECT ###################################################
20+
21+ Set-Location $webHostFolder
22+ dotnet publish -- output (Join-Path $outputFolder " Host" )
23+
24+ # # PUBLISH ANGULAR UI PROJECT #################################################
25+
26+ Set-Location $ngFolder
27+ & ng build - prod
28+ Copy-Item (Join-Path $ngFolder " dist" ) (Join-Path $outputFolder " ng" ) - Recurse
29+ Copy-Item (Join-Path $ngFolder " Dockerfile" ) (Join-Path $outputFolder " ng" )
30+
31+ # Change UI configuration
32+ $ngConfigPath = Join-Path $outputFolder " ng/assets/appconfig.json"
33+ (Get-Content $ngConfigPath ) -replace " 21021" , " 9901" | Set-Content $ngConfigPath
34+ (Get-Content $ngConfigPath ) -replace " 4200" , " 9902" | Set-Content $ngConfigPath
35+
36+ # # CREATE DOCKER IMAGES #######################################################
37+
38+ # Host
39+ Set-Location (Join-Path $outputFolder " Host" )
40+
41+ docker rmi zero/ host -f
42+ docker build - t zero/ host .
43+
44+ # Angular UI
45+ Set-Location (Join-Path $outputFolder " ng" )
46+
47+ docker rmi zero/ ng -f
48+ docker build - t zero/ ng .
49+
50+ # # DOCKER COMPOSE FILES #######################################################
51+
52+ Copy-Item (Join-Path $slnFolder " docker/ng/*.*" ) $outputFolder
53+
54+ # # FINALIZE ###################################################################
55+
56+ Set-Location $outputFolder
0 commit comments