update build scripts
This commit is contained in:
Родитель
01f60a25f7
Коммит
c4835880da
|
@ -1,2 +1,2 @@
|
||||||
$genericTag = "1.0.1.0"
|
$genericTag = "1.0.1.1"
|
||||||
$created = [DateTime]::Now.ToUniversalTime().ToString("yyyyMMddHHmm")
|
$created = [DateTime]::Now.ToUniversalTime().ToString("yyyyMMddHHmm")
|
||||||
|
|
|
@ -2,13 +2,21 @@
|
||||||
|
|
||||||
. (Join-Path $RootPath "settings.ps1")
|
. (Join-Path $RootPath "settings.ps1")
|
||||||
|
|
||||||
|
function Head($text) {
|
||||||
|
try {
|
||||||
|
$s = (New-Object System.Net.WebClient).DownloadString("http://artii.herokuapp.com/make?text=$text")
|
||||||
|
} catch {
|
||||||
|
$s = $text
|
||||||
|
}
|
||||||
|
Write-Host -ForegroundColor Yellow $s
|
||||||
|
}
|
||||||
|
|
||||||
$push = $true
|
$push = $true
|
||||||
|
|
||||||
$supported = @(
|
$supported = @(
|
||||||
"10.0.19042.0"
|
"10.0.19042.0"
|
||||||
"10.0.19041.0"
|
"10.0.19041.0"
|
||||||
"10.0.18363.0"
|
"10.0.18363.0"
|
||||||
"10.0.18362.0"
|
|
||||||
"10.0.17763.0"
|
"10.0.17763.0"
|
||||||
"10.0.14393.0"
|
"10.0.14393.0"
|
||||||
)
|
)
|
||||||
|
@ -18,30 +26,46 @@ $servercoretags = (get-navcontainerimagetags -imageName "mcr.microsoft.com/windo
|
||||||
Sort-Object -Descending { [Version]$_ } |
|
Sort-Object -Descending { [Version]$_ } |
|
||||||
Group-Object { [Version]"$(([Version]$_).Major).$(([Version]$_).Minor).$(([Version]$_).Build).0" } | % { if ($supported.contains($_.Name)) { $_.Group[0] } }
|
Group-Object { [Version]"$(([Version]$_).Major).$(([Version]$_).Minor).$(([Version]$_).Build).0" } | % { if ($supported.contains($_.Name)) { $_.Group[0] } }
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor Yellow "Latest Servercore tags:"
|
||||||
$servercoretags
|
$servercoretags
|
||||||
|
|
||||||
|
$allbctags = (get-navcontainerimagetags -imageName "mcr.microsoft.com/businesscentral").tags |
|
||||||
|
Where-Object { [Version]::TryParse($_, [ref] $ver) }
|
||||||
|
|
||||||
|
$bctags = $allbctags | Sort-Object -Descending { [Version]$_ } |
|
||||||
|
Group-Object { [Version]"$(([Version]$_).Major).$(([Version]$_).Minor).$(([Version]$_).Build).0" } | % { if ($supported.contains($_.Name)) { $_.Group[0] } }
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor Yellow "Latest BusinessCentral tags:"
|
||||||
|
$bctags
|
||||||
|
|
||||||
$basetags = (get-navcontainerimagetags -imageName "mcr.microsoft.com/dotnet/framework/runtime").tags |
|
$basetags = (get-navcontainerimagetags -imageName "mcr.microsoft.com/dotnet/framework/runtime").tags |
|
||||||
Where-Object { $_.StartsWith('4.8-20') } |
|
Where-Object { $_ -like '4.8-20*' -and $_ -notlike '*-2009' -and $_ -notlike '*-1903'} |
|
||||||
Sort-Object -Descending
|
Sort-Object -Descending
|
||||||
|
|
||||||
$basetags
|
$basetags = @(
|
||||||
|
"4.8-windowsservercore-20H2"
|
||||||
|
"4.8-windowsservercore-2004"
|
||||||
|
"4.8-windowsservercore-1909"
|
||||||
|
"4.8-windowsservercore-ltsc2019"
|
||||||
|
"4.8-windowsservercore-ltsc2016"
|
||||||
|
)
|
||||||
|
|
||||||
#throw "go?"
|
#throw "start?"
|
||||||
|
|
||||||
$start = 0
|
$start = 0
|
||||||
$start..($basetags.count-1) | % {
|
$start..($basetags.count-1) | % {
|
||||||
$tag = $basetags[$_]
|
$tag = $basetags[$_]
|
||||||
$dt = $tag.SubString(4,8)
|
|
||||||
$os = $tag.SubString($tag.LastIndexOf('-')+1)
|
$os = $tag.SubString($tag.LastIndexOf('-')+1)
|
||||||
|
|
||||||
Write-Host "$dt $os"
|
Head "$os"
|
||||||
|
|
||||||
$baseimage = "mcr.microsoft.com/dotnet/framework/runtime:$tag"
|
$baseimage = "mcr.microsoft.com/dotnet/framework/runtime:$tag"
|
||||||
$image = "$dt-generic:$os"
|
$image = "generic:$os"
|
||||||
|
|
||||||
docker pull $baseimage
|
docker pull $baseimage
|
||||||
$osversion = docker inspect --format "{{.OsVersion}}" $baseImage
|
$osversion = docker inspect --format "{{.OsVersion}}" $baseImage
|
||||||
|
|
||||||
docker images --format "{{.Repository}}:{{.Tag}}" | % {
|
docker images --format "{{.Repository}}:{{.Tag}}" | % {
|
||||||
if ($_ -eq $image)
|
if ($_ -eq $image)
|
||||||
{
|
{
|
||||||
|
@ -49,38 +73,42 @@ $start..($basetags.count-1) | % {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$isolation = "hyperv"
|
if ($allbctags -notcontains $osversion) {
|
||||||
|
|
||||||
docker build --build-arg baseimage=$baseimage `
|
|
||||||
--build-arg created=$created `
|
|
||||||
--build-arg tag="$genericTag" `
|
|
||||||
--build-arg osversion="$osversion" `
|
|
||||||
--isolation=$isolation `
|
|
||||||
--memory 10G `
|
|
||||||
--tag $image `
|
|
||||||
$RootPath
|
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
throw "Failed with exit code $LastExitCode"
|
|
||||||
}
|
|
||||||
Write-Host "SUCCESS"
|
|
||||||
|
|
||||||
if ($push) {
|
head $osversion
|
||||||
$tags = @(
|
|
||||||
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion"
|
$isolation = "hyperv"
|
||||||
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion-$genericTag"
|
|
||||||
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion-dev"
|
docker build --build-arg baseimage=$baseimage `
|
||||||
)
|
--build-arg created=$created `
|
||||||
$tags | ForEach-Object {
|
--build-arg tag="$genericTag" `
|
||||||
Write-Host "Push $_"
|
--build-arg osversion="$osversion" `
|
||||||
docker tag $image $_
|
--isolation=$isolation `
|
||||||
docker push $_
|
--memory 10G `
|
||||||
|
--tag $image `
|
||||||
|
$RootPath
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "Failed with exit code $LastExitCode"
|
||||||
}
|
}
|
||||||
$tags | ForEach-Object {
|
Write-Host "SUCCESS"
|
||||||
Write-Host "Remove $_"
|
|
||||||
docker rmi $_
|
if ($push) {
|
||||||
|
$tags = @(
|
||||||
|
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion"
|
||||||
|
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion-$genericTag"
|
||||||
|
"mcrbusinesscentral.azurecr.io/public/businesscentral:$osversion-dev"
|
||||||
|
)
|
||||||
|
$tags | ForEach-Object {
|
||||||
|
Write-Host "Push $_"
|
||||||
|
docker tag $image $_
|
||||||
|
docker push $_
|
||||||
|
}
|
||||||
|
$tags | ForEach-Object {
|
||||||
|
Write-Host "Remove $_"
|
||||||
|
docker rmi $_
|
||||||
|
}
|
||||||
|
docker rmi $image
|
||||||
}
|
}
|
||||||
docker rmi $image
|
|
||||||
docker rmi $baseimage
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,95 +16,19 @@ $testImages = $false
|
||||||
|
|
||||||
$pushto = @()
|
$pushto = @()
|
||||||
$pushto = @("dev")
|
$pushto = @("dev")
|
||||||
#$pushto = @("prod")
|
#$pushto += @("prod")
|
||||||
#$pushto = @("dev","prod")
|
|
||||||
|
|
||||||
$tags = @(
|
$ver = [Version]"10.0.0.0"
|
||||||
"10.0.14393.2906-1.0.0.0"
|
$tags = (get-navcontainerimagetags -imageName "mcr.microsoft.com/businesscentral").tags |
|
||||||
"10.0.14393.2972-1.0.0.0"
|
Where-Object { [Version]::TryParse($_, [ref] $ver) }
|
||||||
"10.0.14393.3025-1.0.0.0"
|
|
||||||
"10.0.14393.3085-1.0.0.0"
|
|
||||||
"10.0.14393.3144-1.0.0.0"
|
|
||||||
"10.0.14393.3204-1.0.0.0"
|
|
||||||
"10.0.14393.3326-1.0.0.0"
|
|
||||||
"10.0.14393.3384-1.0.0.0"
|
|
||||||
"10.0.14393.3443-1.0.0.0"
|
|
||||||
"10.0.14393.3630-1.0.0.0"
|
|
||||||
"10.0.14393.3750-1.0.0.0"
|
|
||||||
"10.0.14393.3808-1.0.0.0"
|
|
||||||
"10.0.14393.3866-1.0.0.0"
|
|
||||||
"10.0.14393.3930-1.0.0.0"
|
|
||||||
"10.0.14393.3986-1.0.0.0"
|
|
||||||
"10.0.14393.4046-1.0.0.0"
|
|
||||||
"10.0.17134.1006-1.0.0.0"
|
|
||||||
"10.0.17134.1130-1.0.0.0"
|
|
||||||
"10.0.17134.706-1.0.0.0"
|
|
||||||
"10.0.17134.766-1.0.0.0"
|
|
||||||
"10.0.17134.829-1.0.0.0"
|
|
||||||
"10.0.17134.885-1.0.0.0"
|
|
||||||
"10.0.17134.950-1.0.0.0"
|
|
||||||
"10.0.17763.1158-1.0.0.0"
|
|
||||||
"10.0.17763.1282-1.0.0.0"
|
|
||||||
"10.0.17763.1339-1.0.0.0"
|
|
||||||
"10.0.17763.1397-1.0.0.0"
|
|
||||||
"10.0.17763.1457-1.0.0.0"
|
|
||||||
"10.0.17763.1518-1.0.0.0"
|
|
||||||
"10.0.17763.1577-1.0.0.0"
|
|
||||||
"10.0.17763.437-1.0.0.0"
|
|
||||||
"10.0.17763.504-1.0.0.0"
|
|
||||||
"10.0.17763.557-1.0.0.0"
|
|
||||||
"10.0.17763.615-1.0.0.0"
|
|
||||||
"10.0.17763.678-1.0.0.0"
|
|
||||||
"10.0.17763.737-1.0.0.0"
|
|
||||||
"10.0.17763.864-1.0.0.0"
|
|
||||||
"10.0.17763.914-1.0.0.0"
|
|
||||||
"10.0.17763.973-1.0.0.0"
|
|
||||||
"10.0.18362.1016-1.0.0.0"
|
|
||||||
"10.0.18362.1082-1.0.0.0"
|
|
||||||
"10.0.18362.1139-1.0.0.0"
|
|
||||||
"10.0.18362.116-1.0.0.0"
|
|
||||||
"10.0.18362.1198-1.0.0.0"
|
|
||||||
"10.0.18362.175-1.0.0.0"
|
|
||||||
"10.0.18362.239-1.0.0.0"
|
|
||||||
"10.0.18362.295-1.0.0.0"
|
|
||||||
"10.0.18362.356-1.0.0.0"
|
|
||||||
"10.0.18362.476-1.0.0.0"
|
|
||||||
"10.0.18362.535-1.0.0.0"
|
|
||||||
"10.0.18362.592-1.0.0.0"
|
|
||||||
"10.0.18362.658-1.0.0.0"
|
|
||||||
"10.0.18362.778-1.0.0.0"
|
|
||||||
"10.0.18362.900-1.0.0.0"
|
|
||||||
"10.0.18362.959-1.0.0.0"
|
|
||||||
"10.0.18363.1016-1.0.0.0"
|
|
||||||
"10.0.18363.1082-1.0.0.0"
|
|
||||||
"10.0.18363.1139-1.0.0.0"
|
|
||||||
"10.0.18363.1198-1.0.0.0"
|
|
||||||
"10.0.18363.476-1.0.0.0"
|
|
||||||
"10.0.18363.535-1.0.0.0"
|
|
||||||
"10.0.18363.592-1.0.0.0"
|
|
||||||
"10.0.18363.658-1.0.0.0"
|
|
||||||
"10.0.18363.778-1.0.0.0"
|
|
||||||
"10.0.18363.900-1.0.0.0"
|
|
||||||
"10.0.18363.959-1.0.0.0"
|
|
||||||
"10.0.19041.329-1.0.0.0"
|
|
||||||
"10.0.19041.388-1.0.0.0"
|
|
||||||
"10.0.19041.450-1.0.0.0"
|
|
||||||
"10.0.19041.508-1.0.0.0"
|
|
||||||
"10.0.19041.572-1.0.0.0"
|
|
||||||
"10.0.19041.630-1.0.0.0"
|
|
||||||
"10.0.19042.572-1.0.0.0"
|
|
||||||
"10.0.19042.630-1.0.0.0"
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
[Array]::Reverse($tags)
|
[Array]::Reverse($tags)
|
||||||
|
|
||||||
$oldGenericTag = "1.0.0.1"
|
$oldGenericTag = "1.0.1.0"
|
||||||
$tags | % {
|
$tags | % {
|
||||||
$tag = $_
|
$tag = $_
|
||||||
|
|
||||||
$osversion = $tag.Substring(0,$tag.IndexOf('-'))
|
$image = "my:$tag-$oldGenericTag"
|
||||||
$image = "my:$osversion-$oldGenericTag"
|
|
||||||
|
|
||||||
docker images --format "{{.Repository}}:{{.Tag}}" | % {
|
docker images --format "{{.Repository}}:{{.Tag}}" | % {
|
||||||
if ($_ -eq $image)
|
if ($_ -eq $image)
|
||||||
|
@ -114,6 +38,7 @@ $tags | % {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Pull all
|
||||||
$tags | % {
|
$tags | % {
|
||||||
$tag = $_
|
$tag = $_
|
||||||
head $tag
|
head $tag
|
||||||
|
@ -121,6 +46,8 @@ $tags | % {
|
||||||
docker pull $image
|
docker pull $image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
docker system prune --force
|
||||||
|
|
||||||
throw "go!"
|
throw "go!"
|
||||||
|
|
||||||
$tags | % {
|
$tags | % {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче