diff --git a/Build/show-powershell-images.ps1 b/Build/show-powershell-images.ps1 index c475a5ed..7d9f580c 100644 --- a/Build/show-powershell-images.ps1 +++ b/Build/show-powershell-images.ps1 @@ -1,4 +1,4 @@ -$ErrorActionPreference = "Stop" +$ErrorActionPreference = 'Stop' function Get-ShortVersion { [CmdletBinding()] @@ -9,23 +9,27 @@ function Get-ShortVersion { ) process { - $parts = $FullVersion -split "-" - $result = $parts[0] + # preview-7.5-ubuntu-20.04 + # 7.4-ubuntu-22.04 + # 7.3.0-preview.1-ubuntu-20.04 + $parts = $FullVersion -split '-' + $version = $parts[0] + $tag = $parts[1] - if ($parts[1] -like "preview*") { - $result += "-" + $parts[1] + if ($version -like 'preview*') { + $version = $parts[1] + $tag = $parts[0] } - return $result + if ($tag -like 'preview*') { + $version += '-' + $tag + } + + return $version } } -(Invoke-RestMethod -Uri "https://mcr.microsoft.com/v2/powershell/tags/list").tags ` - | Where-Object {$_ -Like "[0-9]*"} ` - | Get-ShortVersion ` - | Sort-Object -Unique - -# (Invoke-RestMethod -Uri "https://mcr.microsoft.com/v2/powershell/tags/list").tags ` -# | Where-Object {$_ -Like "7.2.0*"} ` -# | Where-Object {($_ -Like "*ubuntu*") -or ($_ -Like "*alpine*")} ` -# | Sort-Object +(Invoke-RestMethod -Uri 'https://mcr.microsoft.com/v2/powershell/tags/list').tags ` +| Where-Object { ($_ -Like '[0-9]*') -or ($_ -Like 'preview-[0-9]*') } ` +| Get-ShortVersion ` +| Sort-Object -Unique \ No newline at end of file diff --git a/Build/tasks/build-tasks.ps1 b/Build/tasks/build-tasks.ps1 index f311e9ee..516d1f0d 100644 --- a/Build/tasks/build-tasks.ps1 +++ b/Build/tasks/build-tasks.ps1 @@ -206,12 +206,10 @@ task PsCoreTest { , "mcr.microsoft.com/powershell:7.2.2-ubuntu-20.04" , "mcr.microsoft.com/powershell:7.3-ubuntu-20.04") - foreach ($image in $images) { - exec { docker pull $image } - } - $builds = @() foreach ($image in $images) { + exec { docker pull -q $image } + foreach ($database in $databases) { $builds += @{ File = "build-tasks.it-ps-core.ps1" diff --git a/Build/tasks/create-images-tasks.ps1 b/Build/tasks/create-images-tasks.ps1 index bc718538..b6a91a5e 100644 --- a/Build/tasks/create-images-tasks.ps1 +++ b/Build/tasks/create-images-tasks.ps1 @@ -17,6 +17,7 @@ task BuildMsSqlDatabase { $dockerfile = Join-Path $context "image-mssql-2017.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/mssql:2017 ` $context @@ -27,6 +28,7 @@ task BuildPgSqlDatabase { $dockerfile = Join-Path $context "image-postgres-133.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/postgres:13.3 ` $context @@ -37,6 +39,7 @@ task BuildMySqlDatabase { $dockerfile = Join-Path $context "image-mysql-8025.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/mysql:8.0.25 ` $context @@ -47,6 +50,7 @@ task BuildDotnetSdk60 { $dockerfile = Join-Path $context "image-dotnet-sdk-6.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:6.0-sdk ` . @@ -57,6 +61,7 @@ task BuildDotnetRuntime60 { $dockerfile = Join-Path $context "image-dotnet-runtime-6.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:6.0-runtime ` . @@ -67,6 +72,7 @@ task BuildDotnetSdk70 { $dockerfile = Join-Path $context "image-dotnet-sdk-7.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:7.0-sdk ` . @@ -77,6 +83,7 @@ task BuildDotnetRuntime70 { $dockerfile = Join-Path $context "image-dotnet-runtime-7.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:7.0-runtime ` . @@ -87,6 +94,7 @@ task BuildDotnetSdk80 { $dockerfile = Join-Path $context "image-dotnet-sdk-8.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:8.0-sdk ` . @@ -97,6 +105,7 @@ task BuildDotnetRuntime80 { $dockerfile = Join-Path $context "image-dotnet-runtime-8.0.dockerfile" exec { docker build ` + --pull ` -f $dockerfile ` -t sqldatabase/dotnet_pwsh:8.0-runtime ` .