Skip to content

Commit 8b8af3c

Browse files
committed
Update docker powershell script
1 parent e3d8e0b commit 8b8af3c

File tree

2 files changed

+33
-57
lines changed

2 files changed

+33
-57
lines changed

aspnet-core/build/build-with-ng.ps1

Lines changed: 33 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,33 @@
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 -ErrorAction Ignore
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-
& yarn
28-
& ng build --prod
29-
Copy-Item (Join-Path $ngFolder "dist") (Join-Path $outputFolder "ng") -Recurse
30-
Copy-Item (Join-Path $ngFolder "Dockerfile") (Join-Path $outputFolder "ng")
31-
32-
# Change UI configuration
33-
$ngConfigPath = Join-Path $outputFolder "ng/assets/appconfig.json"
34-
(Get-Content $ngConfigPath) -replace "44311", "9901" | Set-Content $ngConfigPath
35-
(Get-Content $ngConfigPath) -replace "4200", "9902" | Set-Content $ngConfigPath
36-
37-
## CREATE DOCKER IMAGES #######################################################
38-
39-
# Host
40-
Set-Location (Join-Path $outputFolder "Host")
41-
42-
docker rmi abp/host -f
43-
docker build -t abp/host .
44-
45-
# Angular UI
46-
Set-Location (Join-Path $outputFolder "ng")
47-
48-
docker rmi abp/ng -f
49-
docker build -t abp/ng .
50-
51-
## DOCKER COMPOSE FILES #######################################################
52-
53-
Copy-Item (Join-Path $slnFolder "docker/ng/*.*") $outputFolder
54-
55-
## FINALIZE ###################################################################
56-
57-
Set-Location $outputFolder
1+
echo " Welcome to docker build"
2+
echo ""
3+
echo ""
4+
5+
$ABP_HOST="abp/host"
6+
$ABP_NG="abp/ng"
7+
8+
cd ..
9+
echo " Building docker image $ABP_HOST..."
10+
docker build -t $ABP_HOST .
11+
echo " Done. -- Building docker image $ABP_HOST..."
12+
echo ""
13+
echo ""
14+
15+
# echo " Pushing docker image $ABP_HOST..."
16+
# docker push $ABP_HOST
17+
# echo " Done. -- Pushing docker image $ABP_HOST..."
18+
# echo ""
19+
# echo ""
20+
21+
cd ..
22+
cd angular/
23+
echo " Building docker image $ABP_NG..."
24+
docker build -t $ABP_NG -f Dockerfile .
25+
echo " Done. -- Building docker image $ABP_NG..."
26+
echo ""
27+
echo ""
28+
29+
# echo " Pushing docker image $ABP_NG..."
30+
# docker push $ABP_NG
31+
# echo " Done. -- Pushing docker image $ABP_NG..."
32+
# echo ""
33+
# echo ""

0 commit comments

Comments
 (0)