-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
23 lines (17 loc) · 904 Bytes
/
build.ps1
File metadata and controls
23 lines (17 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Script to build Docker images with cache busting
# This ensures that code changes are ALWAYS picked up
$ErrorActionPreference = "Stop"
# Generate a unique cache bust value (timestamp)
$CACHE_BUST = [int][double]::Parse((Get-Date -UFormat %s))
Write-Host "🔨 Building Docker images with CACHE_BUST=$CACHE_BUST" -ForegroundColor Cyan
Write-Host "📦 This ensures all code changes are included" -ForegroundColor Cyan
# Build all services with the cache bust argument
$buildArgs = @("build", "--build-arg", "CACHE_BUST=$CACHE_BUST") + $args
& docker-compose $buildArgs
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Build complete! All code changes have been included." -ForegroundColor Green
Write-Host "💡 To start services: docker-compose up -d" -ForegroundColor Yellow
} else {
Write-Host "❌ Build failed with exit code $LASTEXITCODE" -ForegroundColor Red
exit $LASTEXITCODE
}