9b71099658
Made-with: Cursor
36 lines
1.2 KiB
PowerShell
36 lines
1.2 KiB
PowerShell
# Docker Push Script for Windows PowerShell
|
|
# Pushes the Docker image to docker-registry.kolpacksoftware.com
|
|
|
|
param(
|
|
[string]$ImageName = "clue-picker",
|
|
[string]$Tag = "latest",
|
|
[string]$Registry = "docker-registry.kolpacksoftware.com"
|
|
)
|
|
|
|
$FullImageName = "${Registry}/${ImageName}:${Tag}"
|
|
|
|
Write-Host "Pushing Docker image: $FullImageName" -ForegroundColor Green
|
|
|
|
$imageExists = docker images $FullImageName --format "{{.Repository}}:{{.Tag}}" | Select-String -Pattern $FullImageName
|
|
|
|
if (-not $imageExists) {
|
|
Write-Host "Image $FullImageName not found locally. Building first..." -ForegroundColor Yellow
|
|
& "$PSScriptRoot\docker-build.ps1" -ImageName $ImageName -Tag $Tag -Registry $Registry
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Build failed!" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
docker push $FullImageName
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Docker push failed!" -ForegroundColor Red
|
|
Write-Host "Make sure you are logged in to the registry:" -ForegroundColor Yellow
|
|
Write-Host " docker login $Registry" -ForegroundColor Cyan
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "Push successful!" -ForegroundColor Green
|
|
Write-Host "Image available at: $FullImageName" -ForegroundColor Cyan
|