From f8ab37bdb49077bf727fcf3e515a3e52ab44fa84 Mon Sep 17 00:00:00 2001 From: dduportal Date: Fri, 8 Oct 2021 16:48:23 +0200 Subject: [PATCH] WiP --- 11/windows/nanoserver-1809/Dockerfile | 28 ++++++++++------ .../windowsservercore-ltsc2019/Dockerfile | 5 ++- 17/windows/nanoserver-1809/Dockerfile | 28 ++++++++++------ .../windowsservercore-ltsc2019/Dockerfile | 5 ++- 8/windows/nanoserver-1809/Dockerfile | 29 ++++++++++------ .../windowsservercore-ltsc2019/Dockerfile | 5 ++- build-windows.yaml | 33 +++++++++++++++++++ build.ps1 | 25 +++++++++++--- 8 files changed, 115 insertions(+), 43 deletions(-) create mode 100644 build-windows.yaml diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index 4150283d2..9f851ad21 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,19 +21,24 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +ARG JAVA_VERSION="11.0.12_7" +FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core -FROM mcr.microsoft.com/windows/servercore:1809 AS core +# If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will +# use the 'latest' +ARG POWERSHELL_VERSION= +FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 -FROM eclipse-temurin:11.0.12_7-jdk-nanoserver-1809 +ARG JAVA_VERSION +ARG JAVA_HOME="C:\openjdk-11" # The nanoserver image is nice and small, but we need a couple of things to get SSH working COPY --from=core /windows/system32/netapi32.dll /windows/system32/netapi32.dll COPY --from=core /windows/system32/whoami.exe /windows/system32/whoami.exe +COPY --from=core $JAVA_HOME $JAVA_HOME SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" +USER ContainerAdministrator ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 @@ -51,10 +56,12 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install ; ` - $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; ` - $NewPath = $CurrentPath + ';C:\mingit\cmd' ; ` - Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath + & C:\mingit\cmd\git.exe lfs install + +ENV ProgramFiles="C:\Program Files" ` + WindowsPATH="C:\Windows\system32;C:\Windows" ` + JAVA_HOME="${JAVA_HOME}" +ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd" ARG user=jenkins @@ -64,7 +71,6 @@ ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 RUN net accounts /maxpwage:unlimited ; ` net user "$env:user" /add /expire:never /passwordreq:no ; ` net localgroup Administrators /add $env:user ; ` - Set-LocalUser -Name $env:user -PasswordNeverExpires 1; ` New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null ARG AGENT_ROOT=C:/Users/$user @@ -73,6 +79,8 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 101f616bb..0032bea11 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -26,9 +26,6 @@ FROM eclipse-temurin:11.0.12_7-jdk-windowsservercore-1809 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` @@ -67,6 +64,8 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index 5a0eb4ff2..5fff5498f 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,19 +21,24 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +ARG JAVA_VERSION="17_35" +FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core -FROM mcr.microsoft.com/windows/servercore:1809 AS core +# If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will +# use the 'latest' +ARG POWERSHELL_VERSION= +FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 -FROM eclipse-temurin:17_35-jdk-nanoserver-1809 +ARG JAVA_VERSION +ARG JAVA_HOME="C:\openjdk-17" # The nanoserver image is nice and small, but we need a couple of things to get SSH working COPY --from=core /windows/system32/netapi32.dll /windows/system32/netapi32.dll COPY --from=core /windows/system32/whoami.exe /windows/system32/whoami.exe +COPY --from=core $JAVA_HOME $JAVA_HOME SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" +USER ContainerAdministrator ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 @@ -51,10 +56,12 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install ; ` - $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; ` - $NewPath = $CurrentPath + ';C:\mingit\cmd' ; ` - Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath + & C:\mingit\cmd\git.exe lfs install + +ENV ProgramFiles="C:\Program Files" ` + WindowsPATH="C:\Windows\system32;C:\Windows" ` + JAVA_HOME="${JAVA_HOME}" +ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd" ARG user=jenkins @@ -64,7 +71,6 @@ ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 RUN net accounts /maxpwage:unlimited ; ` net user "$env:user" /add /expire:never /passwordreq:no ; ` net localgroup Administrators /add $env:user ; ` - Set-LocalUser -Name $env:user -PasswordNeverExpires 1; ` New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null ARG AGENT_ROOT=C:/Users/$user @@ -73,6 +79,8 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index 7f6836908..244756fd7 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -26,9 +26,6 @@ FROM eclipse-temurin:17_35-jdk-windowsservercore-1809 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` @@ -67,6 +64,8 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/8/windows/nanoserver-1809/Dockerfile b/8/windows/nanoserver-1809/Dockerfile index 330e6698b..f03c94d01 100644 --- a/8/windows/nanoserver-1809/Dockerfile +++ b/8/windows/nanoserver-1809/Dockerfile @@ -21,19 +21,24 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +ARG JAVA_VERSION="8u302-b08" +FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core -FROM mcr.microsoft.com/windows/servercore:1809 AS core +# If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will +# use the 'latest' +ARG POWERSHELL_VERSION= +FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 -FROM eclipse-temurin:8u302-b08-jdk-nanoserver-1809 +ARG JAVA_VERSION +ARG JAVA_HOME="C:\openjdk-8" # The nanoserver image is nice and small, but we need a couple of things to get SSH working COPY --from=core /windows/system32/netapi32.dll /windows/system32/netapi32.dll COPY --from=core /windows/system32/whoami.exe /windows/system32/whoami.exe +COPY --from=core $JAVA_HOME $JAVA_HOME SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" +USER ContainerAdministrator ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 @@ -51,10 +56,12 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install ; ` - $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; ` - $NewPath = $CurrentPath + ';C:\mingit\cmd' ; ` - Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath + & C:\mingit\cmd\git.exe lfs install + +ENV ProgramFiles="C:\Program Files" ` + WindowsPATH="C:\Windows\system32;C:\Windows" ` + JAVA_HOME="${JAVA_HOME}" +ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd" ARG user=jenkins @@ -64,7 +71,6 @@ ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 RUN net accounts /maxpwage:unlimited ; ` net user "$env:user" /add /expire:never /passwordreq:no ; ` net localgroup Administrators /add $env:user ; ` - Set-LocalUser -Name $env:user -PasswordNeverExpires 1; ` New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null ARG AGENT_ROOT=C:/Users/$user @@ -73,6 +79,9 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" +RUN echo $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/8/windows/windowsservercore-ltsc2019/Dockerfile b/8/windows/windowsservercore-ltsc2019/Dockerfile index 37d577b3c..30ccf503d 100644 --- a/8/windows/windowsservercore-ltsc2019/Dockerfile +++ b/8/windows/windowsservercore-ltsc2019/Dockerfile @@ -26,9 +26,6 @@ FROM eclipse-temurin:8u302-b08-jdk-windowsservercore-1809 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ARG VERSION=4.10 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - ARG GIT_VERSION=2.33.0 ARG GIT_PATCH_VERSION=2 RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` @@ -67,6 +64,8 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository +ARG VERSION=4.10 +LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` diff --git a/build-windows.yaml b/build-windows.yaml new file mode 100644 index 000000000..e7fcb3c85 --- /dev/null +++ b/build-windows.yaml @@ -0,0 +1,33 @@ +version: '3' + +services: + jdk8-nanoserver: + build: + context: ./8/windows/nanoserver-1809/ + args: + - VERSION=$REMOTING_VERSION + jdk11-nanoserver: + build: + context: ./11/windows/nanoserver-1809/ + args: + - VERSION=$REMOTING_VERSION + jdk17-nanoserver: + build: + context: ./17/windows/nanoserver-1809/ + args: + - VERSION=$REMOTING_VERSION + jdk8-windowsservercore: + build: + context: ./8/windows/windowsservercore-ltsc2019/ + args: + - VERSION=$REMOTING_VERSION + jdk11-windowsservercore: + build: + context: ./11/windows/windowsservercore-ltsc2019/ + args: + - VERSION=$REMOTING_VERSION + jdk17-windowsservercore: + build: + context: ./17/windows/windowsservercore-ltsc2019/ + args: + - VERSION=$REMOTING_VERSION diff --git a/build.ps1 b/build.ps1 index 1a61ced23..379daa617 100644 --- a/build.ps1 +++ b/build.ps1 @@ -39,6 +39,16 @@ if(![String]::IsNullOrWhiteSpace($env:REMOTING_VERSION)) { # this is the jdk version that will be used for the 'bare tag' images, e.g., jdk8-windowsservercore-1809 -> windowsserver-1809 $defaultBuild = '8' $builds = @{} +$env:REMOTING_VERSION = "$RemotingVersion" +$ProgressPreference = 'SilentlyContinue' # Disable Progress bar for faster downloads + +# Ensures that docker-compose is present +# Docker-compose v2 does not works and prints a "not implemented" message (tested with 2.0.1) +$dockerComposeBin = "C:\tools\docker-compose.exe" +if (-not(Test-Path -Path $dockerComposeBin)) { + Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Windows-x86_64.exe" -OutFile "$dockerComposeBin" +} +& "$dockerComposeBin" --version Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object { Get-ChildItem -Directory -Path $_ | Where-Object { Test-Path (Join-Path $_.FullName "Dockerfile") } | ForEach-Object { @@ -59,9 +69,14 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object { } } +# Prebuild in parallel all images to populate the cache +Write-Host "BUILD: Starting Docker Compose General Build" +& "$dockerComposeBin" --file=build-windows.yaml build --parallel --pull +Write-Host "BUILD: Finished Docker Compose General Build" + if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) { foreach($tag in $builds[$Build]['Tags']) { - Write-Host "Building $Build => tag=$tag" + Write-Host "BUILD: Building $Build => tag=$tag" $cmd = "docker build --build-arg VERSION='$RemotingVersion' -t {0}/{1}:{2} {3} {4}" -f $Organization, $Repository, $tag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd @@ -70,7 +85,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) if($tag -eq 'latest') { $buildTag = "$RemotingVersion-$BuildNumber" } - Write-Host "Building $Build => tag=$buildTag" + Write-Host "BUILD: Building $Build => tag=$buildTag" $cmd = "docker build --build-arg VERSION='$RemotingVersion' -t {0}/{1}:{2} {3} {4}" -f $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd } @@ -78,7 +93,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) } else { foreach($b in $builds.Keys) { foreach($tag in $builds[$b]['Tags']) { - Write-Host "Building $b => tag=$tag" + Write-Host "BUILD: Building $b => tag=$tag" $cmd = "docker build --build-arg VERSION='$RemotingVersion' -t {0}/{1}:{2} {3} {4}" -f $Organization, $Repository, $tag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd @@ -87,7 +102,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) if($tag -eq 'latest') { $buildTag = "$RemotingVersion-$BuildNumber" } - Write-Host "Building $Build => tag=$buildTag" + Write-Host "BUILD: Building $Build => tag=$buildTag" $cmd = "docker build --build-arg VERSION='$RemotingVersion' -t {0}/{1}:{2} {3} {4}" -f $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd } @@ -100,6 +115,8 @@ if($lastExitCode -ne 0) { } if($target -eq "test") { + Write-Host "BUILD: Starting test harness" + # Only fail the run afterwards in case of any test failures $testFailed = $false $mod = Get-InstalledModule -Name Pester -MinimumVersion 5.0.0 -MaximumVersion 5.0.2 -ErrorAction SilentlyContinue