diff --git a/README.md b/README.md index 0aa1fe38..bca13b14 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Optional environment variables: ## Windows Jenkins Java Opts -The processing of the JENKINS_JAVA_OPTS environment variable or -JenkinsJavaOpts command line parameter follow the [https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3](command parsing semantics of Powershell). This means that if a parameter contains any characters that are part of an expression in Powershell, it will need to be surrounded by quotes. +The processing of the JENKINS_JAVA_OPTS environment variable or -JenkinsJavaOpts command line parameter follow the [command parsing semantics of Powershell](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3). This means that if a parameter contains any characters that are part of an expression in Powershell, it will need to be surrounded by quotes. For example: -XX:+PrintCommandLineFlags --show-version diff --git a/alpine/Dockerfile b/alpine/Dockerfile index e3acb175..5ebfc400 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -20,11 +20,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 ARG JAVA_MAJOR_VERSION=17 FROM jenkins/agent:"${version}"-alpine-jdk"${JAVA_MAJOR_VERSION}" -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins diff --git a/build-windows.yaml b/build-windows.yaml index 85bf0a9c..0ec6ed1c 100644 --- a/build-windows.yaml +++ b/build-windows.yaml @@ -5,6 +5,7 @@ services: context: ./ dockerfile: ./windows/nanoserver/Dockerfile args: + JAVA_MAJOR_VERSION: 11 version: ${PARENT_IMAGE_VERSION} WINDOWS_VERSION_TAG: ${NANOSERVER_VERSION_TAG} jdk17-nanoserver: @@ -13,6 +14,7 @@ services: context: ./ dockerfile: ./windows/nanoserver/Dockerfile args: + JAVA_MAJOR_VERSION: 17 version: ${PARENT_IMAGE_VERSION} WINDOWS_VERSION_TAG: ${NANOSERVER_VERSION_TAG} jdk11-windowsservercore: @@ -21,6 +23,7 @@ services: context: ./ dockerfile: ./windows/windowsservercore/Dockerfile args: + JAVA_MAJOR_VERSION: 11 version: ${PARENT_IMAGE_VERSION} WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG} jdk17-windowsservercore: @@ -29,5 +32,6 @@ services: context: ./ dockerfile: ./windows/windowsservercore/Dockerfile args: + JAVA_MAJOR_VERSION: 17 version: ${PARENT_IMAGE_VERSION} WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG} diff --git a/build.ps1 b/build.ps1 index 75014b9c..ad2cc91d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -3,8 +3,8 @@ Param( [Parameter(Position=1)] [String] $Target = "build", [String] $Build = '', - [String] $ParentImageVersion = '3131.vf2b_b_798b_ce99-4', - [String] $BuildNumber = '1', + [String] $VersionTag = 'NEXT_TAG_VERSION', + [String] $ParentImageVersion = '3131.vf2b_b_798b_ce99-5', [switch] $PushVersions = $false ) @@ -84,8 +84,8 @@ Invoke-Expression "$baseDockerCmd config --services" 2>$null | ForEach-Object { $windowsVersion = $items[2] $baseImage = "${windowsType}-${windowsVersion}" - $versionTag = "${ParentImageVersion}-${BuildNumber}-${image}" - $tags = @( $image, $versionTag ) + $completeVersionTag = "${VersionTag}-${image}" + $tags = @( $image, $completeVersionTag ) if($jdkMajorVersion -eq "$defaultJdk") { $tags += $baseImage } @@ -215,11 +215,11 @@ if($target -eq "publish") { } if($PushVersions) { - $buildTag = "$ParentImageVersion-$BuildNumber-$tag" + $buildTag = "$VersionTag-$tag" if($tag -eq 'latest') { - $buildTag = "$ParentImageVersion-$BuildNumber" + $buildTag = "$VersionTag" } - Publish-Image "$Build" "${Organization}/${Repository}:${buildTag}" + Publish-Image "$b" "${Organization}/${Repository}:${buildTag}" if($lastExitCode -ne 0) { $publishFailed = 1 } @@ -234,9 +234,9 @@ if($target -eq "publish") { } if($PushVersions) { - $buildTag = "$ParentImageVersion-$BuildNumber-$tag" + $buildTag = "$VersionTag-$tag" if($tag -eq 'latest') { - $buildTag = "$ParentImageVersion-$BuildNumber" + $buildTag = "$VersionTag" } Publish-Image "$b" "${Organization}/${Repository}:${buildTag}" if($lastExitCode -ne 0) { diff --git a/debian/Dockerfile b/debian/Dockerfile index 87ae642e..1037e1ff 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -1,8 +1,8 @@ -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 ARG JAVA_MAJOR_VERSION=17 FROM jenkins/agent:"${version}"-jdk"${JAVA_MAJOR_VERSION}" -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins diff --git a/docker-bake.hcl b/docker-bake.hcl index 76601963..1a24d014 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -32,7 +32,7 @@ variable "IMAGE_TAG" { #### This is for the "parent" image version to use (jenkins/agent:-) variable "PARENT_IMAGE_VERSION" { - default = "3131.vf2b_b_798b_ce99-4" + default = "3131.vf2b_b_798b_ce99-5" } variable "REGISTRY" { diff --git a/updatecli/updatecli.d/docker-agent.yaml b/updatecli/updatecli.d/docker-agent.yaml index 5be71703..5533fa3d 100644 --- a/updatecli/updatecli.d/docker-agent.yaml +++ b/updatecli/updatecli.d/docker-agent.yaml @@ -152,9 +152,9 @@ targets: spec: file: build.ps1 matchpattern: >- - \$ParentImageVersion(.*)=(.*), + ParentImageVersion(.*)=(.*), replacepattern: >- - $ParentImageVersion${1}= '{{ source "lastVersion" }}', + ParentImageVersion${1}= '{{ source "lastVersion" }}', scmid: default actions: diff --git a/windows/nanoserver/Dockerfile b/windows/nanoserver/Dockerfile index f71e02ba..548eb430 100644 --- a/windows/nanoserver/Dockerfile +++ b/windows/nanoserver/Dockerfile @@ -21,12 +21,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 ARG JAVA_MAJOR_VERSION=17 ARG WINDOWS_VERSION_TAG=1809 FROM jenkins/agent:"${version}"-jdk"${JAVA_MAJOR_VERSION}"-nanoserver-"${WINDOWS_VERSION_TAG}" -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" COPY jenkins-agent.ps1 C:/ProgramData/Jenkins diff --git a/windows/windowsservercore/Dockerfile b/windows/windowsservercore/Dockerfile index af38ac64..b1b9e5e8 100644 --- a/windows/windowsservercore/Dockerfile +++ b/windows/windowsservercore/Dockerfile @@ -21,12 +21,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 ARG JAVA_MAJOR_VERSION=17 ARG WINDOWS_VERSION_TAG=ltsc2019 FROM jenkins/agent:"${version}"-jdk"${JAVA_MAJOR_VERSION}"-windowsservercore-"${WINDOWS_VERSION_TAG}" -ARG version=3131.vf2b_b_798b_ce99-4 +ARG version=3131.vf2b_b_798b_ce99-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" COPY jenkins-agent.ps1 C:/ProgramData/Jenkins