-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean-install.ps1
40 lines (28 loc) · 1.5 KB
/
clean-install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
param(
$XM1
)
Write-Host "The purpose of this script to start setup from scratch`n" -ForegroundColor Magenta
Write-Host " 1. Stop all containers`n" -ForegroundColor DarkCyan
Write-Host " 2. Docker Prune -Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes`n" -ForegroundColor DarkCyan
Write-Host " 3. Stop IIS, Stop/Start Host Network Service (HNS)`n" -ForegroundColor DarkCyan
Write-Host " 4. Run .\clean.ps1 from Sitecore > Docker`n" -ForegroundColor DarkCyan
Write-Host " 5. Restore Sitecore CLI Tool`n" -ForegroundColor DarkCyan
Write-Host " 6. Run docker compose up command`n" -ForegroundColor DarkCyan
Write-Host "`n`n1. Stop all containers..." -ForegroundColor Cyan
docker container stop $(docker container ls -q --filter name=docker-examples*);
docker-compose stop; docker-compose down
Write-Host "`n`n2. Docker Prune" -ForegroundColor Cyan
docker system prune
docker rmi $(docker images --format "{{.Repository}}:{{.Tag}}" | findstr "deomo/edge-")
Write-Host "`n`n3. Stop IIS, Stop/Start Host Network Service (HNS)" -ForegroundColor Cyan
iisreset /stop; net stop hns; net start hns
Write-Host "`n`n4. Clean all previous build artifacts" -ForegroundColor Cyan
Push-Location docker
.\clean.ps1
Write-Host "`n`n5. Restore Sitecore CLI tool" -ForegroundColor Cyan
Pop-Location
dotnet tool restore
Write-Host "`n`n6. Build/Compose Docker" -ForegroundColor Cyan
Pop-Location
.\up.ps1
Write-Host "***Setup completed successfully***" -ForegroundColor Green