32 lines
929 B
PowerShell
32 lines
929 B
PowerShell
$branch = git rev-parse --abbrev-ref HEAD
|
|
$branch = $branch.Replace('/', '-').ToLower()
|
|
$container = ("pvm-" + $branch)
|
|
$tag = ($branch + ":latest")
|
|
|
|
$target = Read-Host ("Quale target vuoi usare? (final-prod)")
|
|
|
|
if ($target -eq "") {
|
|
$target = "final-prod"
|
|
}
|
|
|
|
$services = Read-Host("Quali servizi vuoi usare? (http://host.docker.internal:8080)")
|
|
|
|
if ($services -eq "") {
|
|
$services = "http://host.docker.internal:8080"
|
|
}
|
|
|
|
$azienda = Read-Host("Quale azienda vuoi impostare? (integry)")
|
|
|
|
if ($azienda -eq "") {
|
|
$azienda = "integry"
|
|
}
|
|
|
|
docker stop $container
|
|
docker rm $container
|
|
|
|
docker buildx build --load -t $tag --build-arg SERVICES_BASE_URL=$services --build-arg AZIENDA=$azienda --target=$target .
|
|
|
|
docker run --name $container -d --restart unless-stopped -P ($tag)
|
|
|
|
Write-Output ("Eseguito container " + $container + " alla porta:")
|
|
docker container inspect $container --format="{{json .NetworkSettings.Ports }}" |