From bbefe48d7deab1e880d81ada7859abf06f0c006f Mon Sep 17 00:00:00 2001 From: Vincent Latombe Date: Mon, 24 May 2021 15:19:57 +0200 Subject: [PATCH 01/72] Allows to pass JAVA_OPTS to the JVM Just like the linux version --- jenkins-agent.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index 7a52e8fd..5e4e5dc9 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -32,7 +32,8 @@ Param( $DirectConnection = '', $InstanceIdentity = '', $Protocols = '', - $JavaHome = $env:JAVA_HOME + $JavaHome = $env:JAVA_HOME, + $JavaOpts = '' ) # Usage jenkins-agent.ps1 [options] -Url http://jenkins -Secret [SECRET] -Name [AGENT_NAME] @@ -53,9 +54,8 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { # if `docker run` only has one argument, we assume user is running alternate command like `powershell` or `pwsh` to inspect the image Invoke-Expression "$Cmd" } else { - $AgentArguments = @("-cp", "C:/ProgramData/Jenkins/agent.jar", "hudson.remoting.jnlp.Main", "-headless") - # this maps the variable name from th CmdletBinding to environment variables + # this maps the variable name from the CmdletBinding to environment variables $ParamMap = @{ 'Tunnel' = 'JENKINS_TUNNEL'; 'Url' = 'JENKINS_URL'; @@ -66,6 +66,7 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { 'DirectConnection' = 'JENKINS_DIRECT_CONNECTION'; 'InstanceIdentity' = 'JENKINS_INSTANCE_IDENTITY'; 'Protocols' = 'JENKINS_PROTOCOLS'; + 'JavaOpts' = 'JAVA_OPTS'; } # this does some trickery to update the variable from the CmdletBinding @@ -89,6 +90,14 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { } } + $AgentArguments = @() + + if(![System.String]::IsNullOrWhiteSpace($JavaOpts)) { + $AgentArguments += @($JavaOpts.split(" ")) + } + + $AgentArguments += @("-cp", "C:/ProgramData/Jenkins/agent.jar", "hudson.remoting.jnlp.Main", "-headless") + if(![System.String]::IsNullOrWhiteSpace($Tunnel)) { $AgentArguments += @("-tunnel", "`"$Tunnel`"") } @@ -114,7 +123,7 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { if(![System.String]::IsNullOrWhiteSpace($InstanceIdentity)) { $AgentArguments += @('-instanceIdentity', $InstanceIdentity) } - + if(![System.String]::IsNullOrWhiteSpace($Protocols)) { $AgentArguments += @('-protocols', $Protocols) } From fbc67e12fe1e69d083d1d3c07b55b63a4bce0e68 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 5 Dec 2021 20:09:17 -0700 Subject: [PATCH 02/72] Remoting 4.11.2 --- docker-bake.hcl | 4 ++-- make.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index cb8cd648..5ff7a0f2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -37,11 +37,11 @@ variable "JENKINS_REPO" { } variable "REMOTING_VERSION" { - default = "4.11" + default = "4.11.2" } variable "BUILD_NUMBER" { - default = "6" + default = "1" } variable "ON_TAG" { diff --git a/make.ps1 b/make.ps1 index fca71db1..7cdf089e 100644 --- a/make.ps1 +++ b/make.ps1 @@ -4,8 +4,8 @@ Param( [String] $Target = "build", [String] $AdditionalArgs = '', [String] $Build = '', - [String] $VersionTag = '4.11-1', - [String] $DockerAgentVersion = '4.11-1', + [String] $VersionTag = '4.11.2-1', + [String] $DockerAgentVersion = '4.11.2-1', [switch] $PushVersions = $false ) From b50c46d829acb6a340a84d1d8e06e74c564c2fb8 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:33:19 +0000 Subject: [PATCH 03/72] Build agent newer agent image (#253) --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 5ff7a0f2..0ebcb200 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -25,7 +25,7 @@ group "linux-ppc64le" { # update this to use a newer build number for jenkins/docker-agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "1" + default = "4" } variable "REGISTRY" { From 93e8f9957277886f2cf16aa3f195acbce060badc Mon Sep 17 00:00:00 2001 From: bob-rohan Date: Mon, 3 Jan 2022 19:03:28 +0000 Subject: [PATCH 04/72] Add Java 17 alpine (#252) Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- 17/alpine/Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 17/debian/Dockerfile | 2 ++ docker-bake.hcl | 15 +++++++++++++++ jenkins-agent | 15 ++++++++++++++- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 17/alpine/Dockerfile diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile new file mode 100644 index 00000000..324c00fe --- /dev/null +++ b/17/alpine/Dockerfile @@ -0,0 +1,40 @@ +# The MIT License +# +# Copyright (c) 2015-2020, CloudBees, Inc. and other Jenkins contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# 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. + +#TODO(oleg_nenashev): Does it also need an update? +ARG version=latest-alpine-jdk17 +FROM jenkins/agent:$version + +ARG version +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" + +ARG user=jenkins + +USER root +COPY ../../jenkins-agent /usr/local/bin/jenkins-agent +RUN chmod +x /usr/local/bin/jenkins-agent &&\ + ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave +USER ${user} + +ENV JENKINS_ENABLE_FUTURE_JAVA=true + +ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 1539bf2f..c5b65be1 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -12,4 +12,6 @@ RUN chmod +x /usr/local/bin/jenkins-agent &&\ ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave USER ${user} +ENV JENKINS_ENABLE_FUTURE_JAVA=true + ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/docker-bake.hcl b/docker-bake.hcl index 0ebcb200..a70f20f9 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -2,6 +2,7 @@ group "linux" { targets = [ "alpine_jdk8", "alpine_jdk11", + "alpine_jdk17", "debian_jdk8", "debian_jdk11", "debian_jdk17", @@ -79,6 +80,20 @@ target "alpine_jdk11" { platforms = ["linux/amd64"] } +target "alpine_jdk17" { + dockerfile = "17/alpine/Dockerfile" + context = "." + args = { + version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-alpine-jdk17" + } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17-preview": "", + "${REGISTRY}/${JENKINS_REPO}:alpine-jdk17-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17-preview", + ] + platforms = ["linux/amd64"] +} + target "debian_jdk8" { dockerfile = "8/debian/Dockerfile" context = "." diff --git a/jenkins-agent b/jenkins-agent index a6501cf3..4a6760a9 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -118,5 +118,18 @@ else #TODO: Handle the case when the command-line and Environment variable contain different values. #It is fine it blows up for now since it should lead to an error anyway. - exec $JAVA_BIN $JAVA_OPTS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" + FUTURE_OPTS="" + if [ "$JENKINS_ENABLE_FUTURE_JAVA" ] ; then + FUTURE_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.io=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.util.concurrent=ALL-UNNAMED + --add-opens java.base/java.lang.reflect=ALL-UNNAMED + --add-opens java.base/java.text=ALL-UNNAMED + --add-opens java.desktop/java.awt.font=ALL-UNNAMED + " + fi + + exec $JAVA_BIN ${FUTURE_OPTS} $JAVA_OPTS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" + fi From e6fa6a22a2d210472da2d1bd15122d22f40f7ff4 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 15 Jan 2022 12:13:27 -0800 Subject: [PATCH 05/72] Allow the use of multiple arguments (#254) --- jenkins-agent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins-agent b/jenkins-agent index 4a6760a9..bf1b3945 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # The MIT License # @@ -37,9 +37,9 @@ # the agent skips connecting to an HTTP(S) port for connection info. # * JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when instanceIdentity is provided. -if [ $# -eq 1 ] && [ "${1#-}" = "$1" ] ; then +if [ "${1:0:1}" != '-' ]; then - # if `docker run` only has one arguments and it is not an option as `-help`, we assume user is running alternate command like `bash` to inspect the image + # if `docker run`'s first argument does not look like a flag, we assume the user is running an alternate command like `bash` to inspect the image exec "$@" else From b47376283048a590106d76cd1a3417770f3b6079 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Mon, 17 Jan 2022 09:46:25 +0000 Subject: [PATCH 06/72] Revert "Allow the use of multiple arguments" (#257) --- jenkins-agent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins-agent b/jenkins-agent index bf1b3945..4a6760a9 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # The MIT License # @@ -37,9 +37,9 @@ # the agent skips connecting to an HTTP(S) port for connection info. # * JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when instanceIdentity is provided. -if [ "${1:0:1}" != '-' ]; then +if [ $# -eq 1 ] && [ "${1#-}" = "$1" ] ; then - # if `docker run`'s first argument does not look like a flag, we assume the user is running an alternate command like `bash` to inspect the image + # if `docker run` only has one arguments and it is not an option as `-help`, we assume user is running alternate command like `bash` to inspect the image exec "$@" else From ec42eb032a09818e36f043a1c6ac5689e9798d15 Mon Sep 17 00:00:00 2001 From: Allan Burdajewicz Date: Wed, 9 Mar 2022 18:16:12 +1000 Subject: [PATCH 07/72] Specify JENKINS_JAVA_OPTS to pass JVM options that apply to the agent only (#261) --- README.md | 5 +++++ jenkins-agent | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a6e9acd..f11c9aa9 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,17 @@ To run a Docker container with [Work Directory](https://github.com/jenkinsci/rem Optional environment variables: +* `JENKINS_JAVA_BIN`: Path to Java executable to use instead of the default in PATH or obtained from JAVA_HOME +* `JENKINS_JAVA_OPTS` : Java Options to use for the remoting process, otherwise obtained from JAVA_OPTS * `JENKINS_URL`: url for the Jenkins server, can be used as a replacement to `-url` option, or to set alternate jenkins URL * `JENKINS_TUNNEL`: (`HOST:PORT`) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc. * `JENKINS_SECRET`: agent secret, if not set as an argument * `JENKINS_AGENT_NAME`: agent name, if not set as an argument * `JENKINS_AGENT_WORKDIR`: agent work directory, if not set by optional parameter `-workDir` * `JENKINS_WEB_SOCKET`: `true` if the connection should be made via WebSocket rather than TCP +* `JENKINS_DIRECT_CONNECTION`: (`HOST:PORT`) Connect directly to this TCP agent port, skipping the HTTP(S) connection parameter download. +* `JENKINS_INSTANCE_IDENTITY`: The base64 encoded InstanceIdentity byte array of the Jenkins master. When this is set, the agent skips connecting to an HTTP(S) port for connection info. +* `JENKINS_PROTOCOLS`: Specify the remoting protocols to attempt when `JENKINS_INSTANCE_IDENTITY` is provided. ## Configuration specifics diff --git a/jenkins-agent b/jenkins-agent index 4a6760a9..3822dc5f 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -25,6 +25,7 @@ # Usage jenkins-agent.sh [options] -url http://jenkins [SECRET] [AGENT_NAME] # Optional environment variables : # * JENKINS_JAVA_BIN : Java executable to use instead of the default in PATH or obtained from JAVA_HOME +# * JENKINS_JAVA_OPTS : Java Options to use for the remoting process, otherwise obtained from JAVA_OPTS # * JENKINS_TUNNEL : HOST:PORT for a tunnel to route TCP traffic to jenkins host, when jenkins can't be directly accessed over network # * JENKINS_URL : alternate jenkins URL # * JENKINS_SECRET : agent secret, if not set as an argument @@ -96,6 +97,15 @@ else fi fi + if [ "$JENKINS_JAVA_OPTS" ]; then + JAVA_OPTIONS="$JENKINS_JAVA_OPTS" + else + # if JAVA_OPTS is defined, use it + if [ "$JAVA_OPTS" ]; then + JAVA_OPTIONS="$JAVA_OPTS" + fi + fi + # if both required options are defined, do not pass the parameters OPT_JENKINS_SECRET="" if [ -n "$JENKINS_SECRET" ]; then @@ -130,6 +140,6 @@ else " fi - exec $JAVA_BIN ${FUTURE_OPTS} $JAVA_OPTS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" + exec $JAVA_BIN ${FUTURE_OPTS} $JAVA_OPTIONS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" fi From 123d54dbae62538d551c3729510919e7b4cd8f97 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 9 Mar 2022 17:09:24 +0100 Subject: [PATCH 08/72] Move away from deprecated Release Drafter App (#262) --- .github/workflows/release-drafter.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..f87134b2 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,17 @@ +# Note: additional setup is required, see https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc + +name: Release Drafter + +on: + push: + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into the default branch + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5c27e047b44e44b653b1c02e9da8f6a60a6d13d0 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 11 Mar 2022 12:17:28 -0800 Subject: [PATCH 09/72] Remove `--add-opens` directives on Java 17 (#263) --- 17/alpine/Dockerfile | 2 -- 17/debian/Dockerfile | 2 -- jenkins-agent | 14 +------------- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index 324c00fe..52864fa9 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -35,6 +35,4 @@ RUN chmod +x /usr/local/bin/jenkins-agent &&\ ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave USER ${user} -ENV JENKINS_ENABLE_FUTURE_JAVA=true - ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index c5b65be1..1539bf2f 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -12,6 +12,4 @@ RUN chmod +x /usr/local/bin/jenkins-agent &&\ ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave USER ${user} -ENV JENKINS_ENABLE_FUTURE_JAVA=true - ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/jenkins-agent b/jenkins-agent index 3822dc5f..6d1beb26 100755 --- a/jenkins-agent +++ b/jenkins-agent @@ -128,18 +128,6 @@ else #TODO: Handle the case when the command-line and Environment variable contain different values. #It is fine it blows up for now since it should lead to an error anyway. - FUTURE_OPTS="" - if [ "$JENKINS_ENABLE_FUTURE_JAVA" ] ; then - FUTURE_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED - --add-opens java.base/java.io=ALL-UNNAMED - --add-opens java.base/java.util=ALL-UNNAMED - --add-opens java.base/java.util.concurrent=ALL-UNNAMED - --add-opens java.base/java.lang.reflect=ALL-UNNAMED - --add-opens java.base/java.text=ALL-UNNAMED - --add-opens java.desktop/java.awt.font=ALL-UNNAMED - " - fi - - exec $JAVA_BIN ${FUTURE_OPTS} $JAVA_OPTIONS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" + exec $JAVA_BIN $JAVA_OPTIONS -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -headless $TUNNEL $URL $WORKDIR $WEB_SOCKET $DIRECT $PROTOCOLS $INSTANCE_IDENTITY $OPT_JENKINS_SECRET $OPT_JENKINS_AGENT_NAME "$@" fi From 0737c8b5225a59ac23407b420d663e8ccbd51f00 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:37:06 +0000 Subject: [PATCH 10/72] Bump remoting version (#264) --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index a70f20f9..98bdebd4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -26,7 +26,7 @@ group "linux-ppc64le" { # update this to use a newer build number for jenkins/docker-agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "4" + default = "1" } variable "REGISTRY" { @@ -38,7 +38,7 @@ variable "JENKINS_REPO" { } variable "REMOTING_VERSION" { - default = "4.11.2" + default = "4.13" } variable "BUILD_NUMBER" { From e6718ae2d8b0b49bd43e427b48556f80242df20e Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Wed, 20 Apr 2022 10:12:42 -0600 Subject: [PATCH 11/72] Use jenkins/agent:4.13-2 https://github.com/jenkinsci/docker-agent/releases/tag/4.13-2 lists: * fix: enable long paths for git in Windows images (#239) @lemeurherve * Use git lfs 3.1.4, not 3.1.2 (#246) @MarkEWaite * Use Java 17.0.2_8, not 17_35 on Nanoserver (#245) @MarkEWaite * Use git 2.35.3 for Windows (#244) @MarkEWaite * Use remoting 4.13, not 4.12 (#243) @MarkEWaite * Use Alpine 3.15.4, not 3.15.0 (#242) @MarkEWaite * Bump debian from bullseye-20220228 to bullseye-20220328 in /11/bullseye (#237, #240) @dependabot * Bump debian from bullseye-20220228 to bullseye-20220328 in /8/bullseye (#236, #241) @dependabot --- docker-bake.hcl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 98bdebd4..35b186a5 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -24,9 +24,9 @@ group "linux-ppc64le" { targets = [] } -# update this to use a newer build number for jenkins/docker-agent image +# update this to use a newer build number of the jenkins/agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "1" + default = "2" } variable "REGISTRY" { @@ -41,8 +41,9 @@ variable "REMOTING_VERSION" { default = "4.13" } +# Used in the tag pushed to the jenkins/inbound-agent image variable "BUILD_NUMBER" { - default = "1" + default = "2" } variable "ON_TAG" { From fde53e56b601bed5e0258c1fdb127626d1ff7448 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Wed, 20 Apr 2022 10:43:33 -0600 Subject: [PATCH 12/72] Clarify build number comment Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 35b186a5..76593986 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -41,7 +41,7 @@ variable "REMOTING_VERSION" { default = "4.13" } -# Used in the tag pushed to the jenkins/inbound-agent image +# Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it variable "BUILD_NUMBER" { default = "2" } From 11f80cd5315d4ecb5e2b7c89795c7ad8dadbca01 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Wed, 20 Apr 2022 10:44:59 -0600 Subject: [PATCH 13/72] Don't need to change BUILD_NUMBER Pipeline will compute it based on tag string --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 76593986..8e9070cb 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -43,7 +43,7 @@ variable "REMOTING_VERSION" { # Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it variable "BUILD_NUMBER" { - default = "2" + default = "1" } variable "ON_TAG" { From eca3988cbf84e9060667f32b6e671a7ca8e41968 Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Thu, 14 Jul 2022 02:46:59 -0500 Subject: [PATCH 14/72] Now builds also for `linux/arm/v7`. (#269) Co-authored-by: Damien Duportal --- docker-bake.hcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 8e9070cb..2783c1be 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -26,7 +26,7 @@ group "linux-ppc64le" { # update this to use a newer build number of the jenkins/agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "2" + default = "1" } variable "REGISTRY" { @@ -38,7 +38,7 @@ variable "JENKINS_REPO" { } variable "REMOTING_VERSION" { - default = "4.13" + default = "4.13.2" } # Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it @@ -122,7 +122,7 @@ target "debian_jdk11" { "${REGISTRY}/${JENKINS_REPO}:latest", "${REGISTRY}/${JENKINS_REPO}:latest-jdk11", ] - platforms = ["linux/amd64", "linux/arm64", "linux/s390x"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x"] } target "debian_jdk17" { @@ -136,5 +136,5 @@ target "debian_jdk17" { "${REGISTRY}/${JENKINS_REPO}:jdk17-preview", "${REGISTRY}/${JENKINS_REPO}:latest-jdk17-preview", ] - platforms = ["linux/amd64", "linux/arm64"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7"] } From ff9a12e70c460075ae124ef4b08054f08f65f367 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Sat, 3 Sep 2022 20:23:27 +0100 Subject: [PATCH 15/72] Use build number 2 of agent image --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 2783c1be..56cf34b9 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -26,7 +26,7 @@ group "linux-ppc64le" { # update this to use a newer build number of the jenkins/agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "1" + default = "2" } variable "REGISTRY" { @@ -38,7 +38,7 @@ variable "JENKINS_REPO" { } variable "REMOTING_VERSION" { - default = "4.13.2" + default = "4.13.3" } # Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it From 39b51ef9c89d1babf14bf0f1ac929c652a0f2a4a Mon Sep 17 00:00:00 2001 From: jbarlin Date: Fri, 26 Aug 2022 06:31:05 +1000 Subject: [PATCH 16/72] Remove "-preview" from Java 17 images Closes #272 Bumps version of upstream image too --- docker-bake.hcl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 56cf34b9..32d41582 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -88,9 +88,9 @@ target "alpine_jdk17" { version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-alpine-jdk17" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17-preview": "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk17-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17-preview", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17": "", + "${REGISTRY}/${JENKINS_REPO}:alpine-jdk17", + "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17", ] platforms = ["linux/amd64"] } @@ -129,12 +129,12 @@ target "debian_jdk17" { dockerfile = "17/debian/Dockerfile" context = "." args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk17-preview" + version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk17" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17-preview": "", - "${REGISTRY}/${JENKINS_REPO}:jdk17-preview", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk17-preview", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17": "", + "${REGISTRY}/${JENKINS_REPO}:jdk17", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk17", ] platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7"] } From 08e2b9d66c88530c46652860630f2ec73b338115 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Sat, 3 Sep 2022 20:53:02 +0100 Subject: [PATCH 17/72] Remove preview from build-arg --- 17/debian/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 1539bf2f..30afaaaa 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,4 +1,4 @@ -ARG version=4.10-6-jdk17-preview +ARG version=4.13.3-2-jdk17 FROM jenkins/agent:$version ARG version From 0aeed4ccae326597862cd0a8dd96ecf295786309 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:54:22 +0100 Subject: [PATCH 18/72] Stop publishing jdk 8 remoting on master branch --- docker-bake.hcl | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 32d41582..6048fe71 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,9 +1,7 @@ group "linux" { targets = [ - "alpine_jdk8", "alpine_jdk11", "alpine_jdk17", - "debian_jdk8", "debian_jdk11", "debian_jdk17", ] @@ -50,20 +48,6 @@ variable "ON_TAG" { default = "false" } -target "alpine_jdk8" { - dockerfile = "8/alpine/Dockerfile" - context = "." - args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-alpine-jdk8" - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk8": "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk8", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk8", - ] - platforms = ["linux/amd64"] -} - target "alpine_jdk11" { dockerfile = "11/alpine/Dockerfile" context = "." @@ -95,20 +79,6 @@ target "alpine_jdk17" { platforms = ["linux/amd64"] } -target "debian_jdk8" { - dockerfile = "8/debian/Dockerfile" - context = "." - args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk8" - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk8": "", - "${REGISTRY}/${JENKINS_REPO}:jdk8", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk8", - ] - platforms = ["linux/amd64"] -} - target "debian_jdk11" { dockerfile = "11/debian/Dockerfile" context = "." From 9b4d12a8527703e3019f735f5a448cb4ba1187af Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Sun, 25 Sep 2022 08:03:28 -0700 Subject: [PATCH 19/72] Remove Java 8 (#278) Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- 11/windows/nanoserver-1809/Dockerfile | 5 +- .../windowsservercore-ltsc2019/Dockerfile | 6 +- {8 => 17}/windows/nanoserver-1809/Dockerfile | 10 +- .../windowsservercore-ltsc2019}/Dockerfile | 10 +- 8/alpine/Dockerfile | 37 ---- 8/debian/Dockerfile | 37 ---- .../windowsservercore-ltsc2019/Dockerfile | 41 ----- Jenkinsfile | 169 +++++++++--------- jenkins-agent.ps1 | 1 - make.ps1 | 96 ++++++++-- tests/inboundAgent.Tests.ps1 | 122 ++++++++----- tests/test_helpers.psm1 | 14 +- 12 files changed, 265 insertions(+), 283 deletions(-) rename {8 => 17}/windows/nanoserver-1809/Dockerfile (85%) rename {8/windows/windowsservercore-1809 => 17/windows/windowsservercore-ltsc2019}/Dockerfile (84%) delete mode 100644 8/alpine/Dockerfile delete mode 100644 8/debian/Dockerfile delete mode 100644 8/windows/windowsservercore-ltsc2019/Dockerfile diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index 6a659e3d..dade18aa 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -31,10 +31,9 @@ ARG user=jenkins RUN $output = net users ; ` if(-not ($output -match $env:user)) { ` - Write-Host 'user does not exist?' ; ` + net accounts /maxpwage:unlimited ; ` net user $env:user /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - wmic useraccount WHERE Name=$env:user set PasswordExpires=false; ` + net localgroup Administrators /add $env:user ` } COPY jenkins-agent.ps1 C:/ProgramData/Jenkins diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 2b1abbf9..e799522c 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -30,10 +30,10 @@ ARG user=jenkins RUN $output = net users ; ` if(-not ($output -match $env:user)) { ` - Write-Host 'user does not exist?' ; ` - net user $env:user /add /expire:never /passwordreq:no ; ` + net accounts /maxpwage:unlimited ; ` + net user "$env:user" /add /expire:never /passwordreq:no ; ` net localgroup Administrators /add $env:user ; ` - wmic useraccount WHERE Name=$env:user set PasswordExpires=false; ` + Set-LocalUser -Name $env:user -PasswordNeverExpires 1 ` } COPY jenkins-agent.ps1 C:/ProgramData/Jenkins diff --git a/8/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile similarity index 85% rename from 8/windows/nanoserver-1809/Dockerfile rename to 17/windows/nanoserver-1809/Dockerfile index 2ff93eb1..d759da67 100644 --- a/8/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -1,7 +1,7 @@ # escape=` # The MIT License # -# Copyright (c) 2019-2020, Alex Earl +# Copyright (c) 2019, Alex Earl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,18 +22,18 @@ # THE SOFTWARE. ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-nanoserver-1809 +FROM jenkins/agent:${VERSION}-jdk17-nanoserver-1809 +ARG VERSION LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" ARG user=jenkins RUN $output = net users ; ` if(-not ($output -match $env:user)) { ` - Write-Host 'user does not exist?' ; ` + net accounts /maxpwage:unlimited ; ` net user $env:user /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - wmic useraccount WHERE Name=$env:user set PasswordExpires=false; ` + net localgroup Administrators /add $env:user ` } COPY jenkins-agent.ps1 C:/ProgramData/Jenkins diff --git a/8/windows/windowsservercore-1809/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile similarity index 84% rename from 8/windows/windowsservercore-1809/Dockerfile rename to 17/windows/windowsservercore-ltsc2019/Dockerfile index 7acc0943..e22986c5 100644 --- a/8/windows/windowsservercore-1809/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -1,7 +1,7 @@ # escape=` # The MIT License # -# Copyright (c) 2019-2020, Alex Earl +# Copyright (c) 2019, Alex Earl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ # THE SOFTWARE. ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-windowsservercore-1809 +FROM jenkins/agent:${VERSION}-jdk17-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" @@ -30,10 +30,10 @@ ARG user=jenkins RUN $output = net users ; ` if(-not ($output -match $env:user)) { ` - Write-Host 'user does not exist?' ; ` - net user $env:user /add /expire:never /passwordreq:no ; ` + net accounts /maxpwage:unlimited ; ` + net user "$env:user" /add /expire:never /passwordreq:no ; ` net localgroup Administrators /add $env:user ; ` - wmic useraccount WHERE Name=$env:user set PasswordExpires=false; ` + Set-LocalUser -Name $env:user -PasswordNeverExpires 1 ` } COPY jenkins-agent.ps1 C:/ProgramData/Jenkins diff --git a/8/alpine/Dockerfile b/8/alpine/Dockerfile deleted file mode 100644 index 17aef063..00000000 --- a/8/alpine/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2017, CloudBees, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# 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 version=4.9-1-alpine -FROM jenkins/agent:$version - -ARG version -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" - -ARG user=jenkins - -USER root -COPY ../../jenkins-agent /usr/local/bin/jenkins-agent -RUN chmod +x /usr/local/bin/jenkins-agent &&\ - ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave -USER ${user} - -ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/8/debian/Dockerfile b/8/debian/Dockerfile deleted file mode 100644 index ed1b1fd0..00000000 --- a/8/debian/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2017, CloudBees, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# 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 version=4.9-1 -FROM jenkins/agent:$version - -ARG version -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" - -ARG user=jenkins - -USER root -COPY ../../jenkins-agent /usr/local/bin/jenkins-agent -RUN chmod +x /usr/local/bin/jenkins-agent &&\ - ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave -USER ${user} - -ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/8/windows/windowsservercore-ltsc2019/Dockerfile b/8/windows/windowsservercore-ltsc2019/Dockerfile deleted file mode 100644 index 16cd52fc..00000000 --- a/8/windows/windowsservercore-ltsc2019/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# escape=` -# The MIT License -# -# Copyright (c) 2019-2020, Alex Earl -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# 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 VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-windowsservercore-ltsc2019 - -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" - -ARG user=jenkins - -RUN $output = net users ; ` - if(-not ($output -match $env:user)) { ` - Write-Host 'user does not exist?' ; ` - net user $env:user /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - wmic useraccount WHERE Name=$env:user set PasswordExpires=false; ` - } - -COPY jenkins-agent.ps1 C:/ProgramData/Jenkins -USER ${user} -ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins-agent.ps1"] diff --git a/Jenkinsfile b/Jenkinsfile index cd794ed7..95083555 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,107 +11,116 @@ pipeline { } stages { - stage('Build') { - parallel { - stage('Windows') { - agent { - label 'docker-windows' - } - options { - timeout(time: 60, unit: 'MINUTES') - } - environment { - DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" + stage('Linux') { + agent { + label "docker&&linux" + } + options { + timeout(time: 30, unit: 'MINUTES') + } + environment { + JENKINS_REPO = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}/inbound-agent" + } + steps { + script { + def branchName = "${env.BRANCH_NAME}" + infra.withDockerCredentials { + if (branchName ==~ 'master') { + // publish the images to Dockerhub + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx bake --push --file docker-bake.hcl linux + ''' + } else if (env.TAG_NAME == null) { + sh 'make build' + sh 'make test' + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx bake --file docker-bake.hcl linux + ''' + } } - steps { - powershell '& ./make.ps1 test' - script { - def branchName = "${env.BRANCH_NAME}" - if (branchName ==~ 'master') { - // we can't use dockerhub builds for windows - // so we publish here - infra.withDockerCredentials { - powershell '& ./make.ps1 publish' - } - } - def tagName = "${env.TAG_NAME}" - if(tagName =~ /\d(\.\d)+(-\d+)?/) { - // we need to build and publish the tagged version - infra.withDockerCredentials { - powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish" - } + if(env.TAG_NAME != null) { + def tagItems = env.TAG_NAME.split('-') + if(tagItems.length == 2) { + def remotingVersion = tagItems[0] + def buildNumber = tagItems[1] + // we need to build and publish the tag version + infra.withDockerCredentials { + sh """ + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + export REMOTING_VERSION=$remotingVersion + export BUILD_NUMBER=$buildNumber + export ON_TAG=true + docker buildx bake --push --file docker-bake.hcl linux + """ } } } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') - } - } } - stage('Linux') { - agent { - label "docker&&linux" - } - options { - timeout(time: 30, unit: 'MINUTES') - } - environment { - JENKINS_REPO = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}/inbound-agent" + } + post { + always { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') + } + } + } + + stage('Windows') { + matrix { + axes { + axis { + name 'IMAGE_NAME' + values 'jdk11-windowsservercore-ltsc2019', 'jdk11-nanoserver-1809', 'jdk17-windowsservercore-ltsc2019', 'jdk17-nanoserver-1809' } - steps { - script { - def branchName = "${env.BRANCH_NAME}" - infra.withDockerCredentials { + } + + stages { + stage('Build') { + agent { + label 'docker-windows' + } + options { + timeout(time: 60, unit: 'MINUTES') + } + environment { + DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" + } + steps { + powershell "& ./make.ps1 -Build ${env.IMAGE_NAME} test" + script { + def branchName = "${env.BRANCH_NAME}" if (branchName ==~ 'master') { - // publish the images to Dockerhub - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --push --file docker-bake.hcl linux - ''' - } else if (env.TAG_NAME == null) { - sh 'make build' - sh 'make test' - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --file docker-bake.hcl linux - ''' + // we can't use dockerhub builds for windows + // so we publish here + infra.withDockerCredentials { + powershell '& ./make.ps1 publish' + } } - } - if(env.TAG_NAME != null) { - def tagItems = env.TAG_NAME.split('-') - if(tagItems.length == 2) { - def remotingVersion = tagItems[0] - def buildNumber = tagItems[1] - // we need to build and publish the tag version + def tagName = "${env.TAG_NAME}" + if(tagName =~ /\d(\.\d)+(-\d+)?/) { + // we need to build and publish the tagged version infra.withDockerCredentials { - sh """ - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - export REMOTING_VERSION=$remotingVersion - export BUILD_NUMBER=$buildNumber - export ON_TAG=true - docker buildx bake --push --file docker-bake.hcl linux - """ + powershell "& ./make.ps1 -Build ${env.IMAGE_NAME} -PushVersions -VersionTag $tagName publish" } } } } - } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') + post { + always { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') + } } } } } } } - } // vim: ft=groovy diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index 33d0e1bd..7e0ae27d 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -53,7 +53,6 @@ Param( # * JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when instanceIdentity is provided. if(![System.String]::IsNullOrWhiteSpace($Cmd)) { - # if `docker run` only has one argument, we assume user is running alternate command like `powershell` or `pwsh` to inspect the image Invoke-Expression "$Cmd" } else { diff --git a/make.ps1 b/make.ps1 index 7cdf089e..f4deb914 100644 --- a/make.ps1 +++ b/make.ps1 @@ -21,7 +21,7 @@ if(![String]::IsNullOrWhiteSpace($env:DOCKERHUB_ORGANISATION)) { } # this is the jdk version that will be used for the 'bare tag' images, e.g., jdk8-windowsservercore-1809 -> windowsserver-1809 -$defaultBuild = '8' +$defaultBuild = '11' $builds = @{} Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object { @@ -30,7 +30,7 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object { $items = $dir.Split("\") $jdkVersion = $items[0] $baseImage = $items[2] - $basicTag = "jdk${jdkVersion}-${baseImage}" + $basicTag = "jdk${jdkVersion}-${baseImage}" $tags = @( $basicTag ) if($jdkVersion -eq $defaultBuild) { $tags += $baseImage @@ -39,16 +39,18 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object { $builds[$basicTag] = @{ 'Folder' = $dir; 'Tags' = $tags; - } + } } } +$exitCodes = 0 if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) { foreach($tag in $builds[$Build]['Tags']) { Copy-Item -Path 'jenkins-agent.ps1' -Destination (Join-Path $builds[$Build]['Folder'] 'jenkins-agent.ps1') -Force Write-Host "Building $Build => tag=$tag" $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd + $exitCodes += $lastExitCode if($PushVersions) { $buildTag = "$VersionTag-$tag" @@ -58,6 +60,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) Write-Host "Building $Build => tag=$buildTag" $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd + $exitCodes += $lastExitCode } } } else { @@ -67,6 +70,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) Write-Host "Building $b => tag=$tag" $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd + $exitCodes += $lastExitCode if($PushVersions) { $buildTag = "$VersionTag-$tag" @@ -76,49 +80,102 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) Write-Host "Building $Build => tag=$buildTag" $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd + $exitCodes += $lastExitCode } } } } -if($lastExitCode -ne 0) { - exit $lastExitCode +if($exitCodes -ne 0) { + Write-Host "Image build stage failed!" + exit 1 +} else { + Write-Host "Image build stage passed!" } if($Target -eq "test") { - $mod = Get-InstalledModule -Name Pester -MinimumVersion 4.9.0 -MaximumVersion 4.99.99 -ErrorAction SilentlyContinue + # Only fail the run afterwards in case of any test failures + $testFailed = $false + + $mod = Get-InstalledModule -Name Pester -MinimumVersion 5.3.0 -MaximumVersion 5.3.3 -ErrorAction SilentlyContinue if($null -eq $mod) { $module = "c:\Program Files\WindowsPowerShell\Modules\Pester" - if(Test-Path $module) { + if(Test-Path $module) { takeown /F $module /A /R icacls $module /reset icacls $module /grant Administrators:'F' /inheritance:d /T Remove-Item -Path $module -Recurse -Force -Confirm:$false } - Install-Module -Force -Name Pester -MaximumVersion 4.99.99 + Install-Module -Force -Name Pester -MaximumVersion 5.3.3 } + Import-Module Pester + $configuration = [PesterConfiguration]::Default + $configuration.Run.PassThru = $true + $configuration.Run.Path = '.\tests' + $configuration.Run.Exit = $true + $configuration.TestResult.Enabled = $true + $configuration.TestResult.OutputFormat = 'JUnitXml' + $configuration.Output.Verbosity = 'Diagnostic' + $configuration.CodeCoverage.Enabled = $false + if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) { + $folder = $builds[$Build]['Folder'] $env:FOLDER = $builds[$Build]['Folder'] $env:VERSION = $DockerAgentVersion - Invoke-Pester -Path tests -EnableExit + + if(Test-Path ".\target\$folder") { + Remove-Item -Recurse -Force ".\target\$folder" + } + New-Item -Path ".\target\$folder" -Type Directory | Out-Null + $configuration.TestResult.OutputPath = ".\target\$folder\junit-results.xml" + $TestResults = Invoke-Pester -Configuration $configuration + if ($TestResults.FailedCount -gt 0) { + Write-Host "There were $($TestResults.FailedCount) failed tests in $Build" + $testFailed = $true + } else { + Write-Host "There were $($TestResults.PassedCount) passed tests out of $($TestResults.TotalCount) in $Build" + } + Remove-Item env:\FOLDER } else { foreach($b in $builds.Keys) { - $env:FOLDER = $builds[$b]['Folder'] + $folder = $builds[$b]['Folder'] + $env:FOLDER = $folder $env:VERSION = $DockerAgentVersion - Invoke-Pester -Path tests -EnableExit + if(Test-Path ".\target\$folder") { + Remove-Item -Recurse -Force ".\target\$folder" + } + New-Item -Path ".\target\$folder" -Type Directory | Out-Null + $configuration.TestResult.OutputPath = ".\target\$folder\junit-results.xml" + $TestResults = Invoke-Pester -Configuration $configuration + if ($TestResults.FailedCount -gt 0) { + Write-Host "There were $($TestResults.FailedCount) failed tests in $Build" + $testFailed = $true + } else { + Write-Host "There were $($TestResults.PassedCount) passed tests out of $($TestResults.TotalCount) in $Build" + } Remove-Item env:\FOLDER } } + + # Fail if any test failures + if($testFailed -ne $false) { + Write-Error "Test stage failed!" + exit 1 + } else { + Write-Host "Test stage passed!" + } } +$exitCodes = 0 if($Target -eq "publish") { if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) { foreach($tag in $Builds[$Build]['Tags']) { Write-Host "Publishing $Build => tag=$tag" $cmd = "docker push {0}/{1}:{2}" -f $Organization, $Repository, $tag Invoke-Expression $cmd + $exitCodes += $lastExitCode if($PushVersions) { $buildTag = "$VersionTag-$tag" @@ -128,6 +185,7 @@ if($Target -eq "publish") { Write-Host "Publishing $Build => tag=$buildTag" $cmd = "docker push {0}/{1}:{2}" -f $Organization, $Repository, $buildTag Invoke-Expression $cmd + $exitCodes += $lastExitCode } } } else { @@ -136,6 +194,7 @@ if($Target -eq "publish") { Write-Host "Publishing $b => tag=$tag" $cmd = "docker push {0}/{1}:{2}" -f $Organization, $Repository, $tag Invoke-Expression $cmd + $exitCodes += $lastExitCode if($PushVersions) { $buildTag = "$VersionTag-$tag" @@ -145,16 +204,17 @@ if($Target -eq "publish") { Write-Host "Publishing $Build => tag=$buildTag" $cmd = "docker push {0}/{1}:{2}" -f $Organization, $Repository, $buildTag Invoke-Expression $cmd + $exitCodes += $lastExitCode } } } } -} - -if($lastExitCode -ne 0) { - Write-Error "Build failed!" -} else { - Write-Host "Build finished successfully" + if($exitCodes -ne 0) { + Write-Error "Publish stage failed!" + } else { + Write-Host "Publish stage passed!" + } } -exit $lastExitCode + +exit $exitCodes diff --git a/tests/inboundAgent.Tests.ps1 b/tests/inboundAgent.Tests.ps1 index dc8f6a1a..c7cad3f0 100644 --- a/tests/inboundAgent.Tests.ps1 +++ b/tests/inboundAgent.Tests.ps1 @@ -1,48 +1,49 @@ Import-Module -DisableNameChecking -Force $PSScriptRoot/test_helpers.psm1 -$AGENT_IMAGE='jenkins-inbound-agent' -$AGENT_CONTAINER='pester-jenkins-inbound-agent' -$SHELL="powershell.exe" +$global:AGENT_IMAGE='jenkins-inbound-agent' +$global:AGENT_CONTAINER='pester-jenkins-inbound-agent' +$global:SHELL="powershell.exe" -$FOLDER = Get-EnvOrDefault 'FOLDER' '' -$VERSION = Get-EnvOrDefault 'VERSION' '4.9-1' +$global:FOLDER = Get-EnvOrDefault 'FOLDER' '' +$global:VERSION = Get-EnvOrDefault 'VERSION' '4.9-1' -$REAL_FOLDER=Resolve-Path -Path "$PSScriptRoot/../${FOLDER}" +$REAL_FOLDER=Resolve-Path -Path "$PSScriptRoot/../${global:FOLDER}" -if(($FOLDER -match '^(?[0-9]+)[\\/](?.+)$') -and (Test-Path $REAL_FOLDER)) { - $JDK = $Matches['jdk'] - $FLAVOR = $Matches['flavor'] +if(($global:FOLDER -match '^(?[0-9]+)[\\/](?.+)$') -and (Test-Path $REAL_FOLDER)) { + $global:JDK = $Matches['jdk'] + $global:FLAVOR = $Matches['flavor'] } else { - Write-Error "Wrong folder format or folder does not exist: $FOLDER" + Write-Error "Wrong folder format or folder does not exist: $global:FOLDER" exit 1 } -if($FLAVOR -match "nanoserver-(\d+)") { - $AGENT_IMAGE += "-nanoserver" - $AGENT_CONTAINER += "-nanoserver-$($Matches[1])" - $SHELL = "pwsh.exe" +if($global:FLAVOR -match "nanoserver-(\d+)") { + $global:AGENT_IMAGE += "-nanoserver" + $global:AGENT_CONTAINER += "-nanoserver-$($Matches[1])" + $global:SHELL = "pwsh.exe" } -if($JDK -eq "11") { - $AGENT_IMAGE += ":jdk11" - $AGENT_CONTAINER += "-jdk11" +if($global:JDK -eq "17") { + $global:AGENT_IMAGE += ":jdk17" + $global:AGENT_CONTAINER += "-jdk17" } else { - $AGENT_IMAGE += ":latest" + $global:AGENT_IMAGE += ":latest" } -Cleanup($AGENT_CONTAINER) +Cleanup($global:AGENT_CONTAINER) Cleanup("nmap") CleanupNetwork("jnlp-network") BuildNcatImage -Describe "[$JDK $FLAVOR] build image" { +Describe "[$global:JDK $global:FLAVOR] build image" { BeforeAll { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." } It 'builds image' { - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg 'VERSION=$VERSION' -t $AGENT_IMAGE $FOLDER" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=$global:VERSION -t $global:AGENT_IMAGE $global:FOLDER" + # This failure was added on purpose to verify that the build will fail if a test fails $exitCode | Should -Be 0 } @@ -51,44 +52,45 @@ Describe "[$JDK $FLAVOR] build image" { } } -Describe "[$JDK $FLAVOR] check user account" { +Describe "[$global:JDK $global:FLAVOR] check default user account" { BeforeAll { - docker run -d -it --name "$AGENT_CONTAINER" -P "$AGENT_IMAGE" "$SHELL" - Is-ContainerRunning $AGENT_CONTAINER + docker run -d -it --name "$global:AGENT_CONTAINER" -P "$global:AGENT_IMAGE" -Cmd "$global:SHELL" + $LASTEXITCODE | Should -Be 0 + Is-ContainerRunning $global:AGENT_CONTAINER | Should -BeTrue } - It 'Password never expires' { - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $AGENT_CONTAINER $SHELL -C `"if((net user jenkins | Select-String -Pattern 'Password expires') -match 'Never') { exit 0 } else { exit -1 }`"" + It 'has a password that never expires' { + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -C `"if((net user jenkins | Select-String -Pattern 'Password expires') -match 'Never') { exit 0 } else { net user jenkins ; exit -1 }`"" $exitCode | Should -Be 0 } - It 'Password not required' { - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $AGENT_CONTAINER $SHELL -C `"if((net user jenkins | Select-String -Pattern 'Password required') -match 'No') { exit 0 } else { exit -1 }`"" + It 'has password policy of "not required"' { + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -C `"if((net user jenkins | Select-String -Pattern 'Password required') -match 'No') { exit 0 } else { net user jenkins ; exit -1 }`"" $exitCode | Should -Be 0 } AfterAll { - Cleanup($AGENT_CONTAINER) + Cleanup($global:AGENT_CONTAINER) } } -Describe "[$JDK $FLAVOR] image has jenkins-agent.ps1 in the correct location" { +Describe "[$global:JDK $global:FLAVOR] image has jenkins-agent.ps1 in the correct location" { BeforeAll { - & docker run -dit --name "$AGENT_CONTAINER" -P "$AGENT_IMAGE" $SHELL - Is-ContainerRunning $AGENT_CONTAINER | Should -BeTrue + & docker run -dit --name "$global:AGENT_CONTAINER" -P "$global:AGENT_IMAGE" -Cmd $global:SHELL + Is-ContainerRunning $global:AGENT_CONTAINER | Should -BeTrue } It 'has jenkins-agent.ps1 in C:/ProgramData/Jenkins' { - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $AGENT_CONTAINER $SHELL -C `"if(Test-Path 'C:/ProgramData/Jenkins/jenkins-agent.ps1') { exit 0 } else { exit 1 }`"" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -C `"if(Test-Path 'C:/ProgramData/Jenkins/jenkins-agent.ps1') { exit 0 } else { exit 1 }`"" $exitCode | Should -Be 0 } AfterAll { - Cleanup($AGENT_CONTAINER) + Cleanup($global:AGENT_CONTAINER) } } -Describe "[$JDK $FLAVOR] image starts jenkins-agent.ps1 correctly (slow test)" { +Describe "[$global:JDK $global:FLAVOR] image starts jenkins-agent.ps1 correctly (slow test)" { It 'connects to the nmap container' { $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "network create --driver nat jnlp-network" # Launch the netcat utility, listening at port 5000 for 30 sec @@ -104,9 +106,11 @@ Describe "[$JDK $FLAVOR] image starts jenkins-agent.ps1 correctly (slow test)" { $nmap_ip = $stdout.Trim() # run Jenkins agent which tries to connect to the nmap container at port 5000 - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --network=jnlp-network --name $AGENT_CONTAINER $AGENT_IMAGE -Url http://${nmap_ip}:5000 -Secret aaa -Name bbb" + $secret = "aaa" + $name = "bbb" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --network=jnlp-network --name $global:AGENT_CONTAINER $global:AGENT_IMAGE -Url http://${nmap_ip}:5000 $secret $name" $exitCode | Should -Be 0 - Is-ContainerRunning $AGENT_CONTAINER | Should -BeTrue + Is-ContainerRunning $global:AGENT_CONTAINER | Should -BeTrue $exitCode, $stdout, $stderr = Run-Program 'docker.exe' 'wait nmap' $exitCode, $stdout, $stderr = Run-Program 'docker.exe' 'logs nmap' @@ -115,38 +119,60 @@ Describe "[$JDK $FLAVOR] image starts jenkins-agent.ps1 correctly (slow test)" { } AfterAll { - Cleanup($AGENT_CONTAINER) + Cleanup($global:AGENT_CONTAINER) Cleanup("nmap") CleanupNetwork("jnlp-network") } } -Describe "[$JDK $FLAVOR] build args" { +Describe "[$global:JDK $global:FLAVOR] build args" { BeforeAll { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." - } - - It -Skip 'uses build args correctly' { - $TEST_VERSION="4.3" + # an old jdk11 image version + $TEST_VERSION="4.7" + $DOCKER_AGENT_VERSION_SUFFIX="1" + if($global:JDK -eq '17') { + # the first jdk17 images for Windows + $TEST_VERSION = "4.10" + $DOCKER_AGENT_VERSION_SUFFIX="7" + } $TEST_USER="foo" + $ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" + } - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=${TEST_VERSION}-2 --build-arg user=$TEST_USER -t $AGENT_IMAGE $FOLDER" + It 'builds image with arguments' { + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=${ARG_TEST_VERSION} --build-arg user=$TEST_USER -t $global:AGENT_IMAGE $global:FOLDER" $exitCode | Should -Be 0 - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --name $AGENT_CONTAINER -P $AGENT_IMAGE $SHELL" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --name $global:AGENT_CONTAINER -P $global:AGENT_IMAGE -Cmd $global:SHELL" $exitCode | Should -Be 0 - Is-ContainerRunning "$AGENT_CONTAINER" | Should -BeTrue + Is-ContainerRunning "$global:AGENT_CONTAINER" | Should -BeTrue + } - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $AGENT_CONTAINER $SHELL -c `"java -cp C:/ProgramData/Jenkins/agent.jar hudson.remoting.jnlp.Main -version`"" + It "has the correct agent.jar version" { + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -c `"java -cp C:/ProgramData/Jenkins/agent.jar hudson.remoting.jnlp.Main -version`"" $exitCode | Should -Be 0 $stdout | Should -Match $TEST_VERSION + } - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $AGENT_CONTAINER $SHELL -c `"(Get-ChildItem env:\ | Where-Object { `$_.Name -eq 'USERNAME' }).Value`"" + It "has the correct (overridden) user account and the container is running as that user" { + # check that the user exists and is the user the container is running as + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -c `"(Get-ChildItem env:\ | Where-Object { `$_.Name -eq 'USERNAME' }).Value`"" $exitCode | Should -Be 0 $stdout | Should -Match $TEST_USER } + It "has the correct password policy for overridden user account" { + # check that $TEST_USER's password never expires and that password is NOT required to login + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -C `"if((net user $TEST_USER | Select-String -Pattern 'Password expires') -match 'Never') { exit 0 } else { net user $TEST_USER ; exit -1 }`"" + $exitCode | Should -Be 0 + + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "exec $global:AGENT_CONTAINER $global:SHELL -C `"if((net user $TEST_USER | Select-String -Pattern 'Password required') -match 'No') { exit 0 } else { net user $TEST_USER ; exit -1 }`"" + $exitCode | Should -Be 0 + } + AfterAll { + Cleanup($global:AGENT_CONTAINER) Pop-Location -StackName 'agent' } } diff --git a/tests/test_helpers.psm1 b/tests/test_helpers.psm1 index 43ae3063..69395da0 100644 --- a/tests/test_helpers.psm1 +++ b/tests/test_helpers.psm1 @@ -72,8 +72,12 @@ function Retry-Command { } function Cleanup($name='') { - docker kill "$name" 2>&1 | Out-Null - docker rm -fv "$name" 2>&1 | Out-Null + try { + docker kill "$name" 2>&1 | Out-Null + docker rm -fv "$name" 2>&1 | Out-Null + } catch { + # do nothing.... + } } function CleanupNetwork($name) { @@ -91,8 +95,8 @@ function Is-ContainerRunning($container) { } } -function Run-Program($cmd, $params, $quiet=$true) { - if(-not $quiet) { +function Run-Program($cmd, $params, $quiet=$false, $debug=$false) { + if($debug) { Write-Host "cmd = $cmd, params = $params" } $psi = New-Object System.Diagnostics.ProcessStartInfo @@ -118,7 +122,7 @@ function Run-Program($cmd, $params, $quiet=$true) { function BuildNcatImage() { Write-Host "Building nmap image for testing" - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "inspect --type=image nmap" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "inspect --type=image nmap" $true if($exitCode -ne 0) { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build -t nmap -f ./tests/netcat-helper/Dockerfile-windows ./tests/netcat-helper" From 11b10b53f25fd990852f15baf71980f0780ed57d Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Sun, 25 Sep 2022 23:07:23 +0100 Subject: [PATCH 20/72] Update base image to latest remoting (#281) --- docker-bake.hcl | 4 ++-- make.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 6048fe71..4abb65a2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -24,7 +24,7 @@ group "linux-ppc64le" { # update this to use a newer build number of the jenkins/agent image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "2" + default = "1" } variable "REGISTRY" { @@ -36,7 +36,7 @@ variable "JENKINS_REPO" { } variable "REMOTING_VERSION" { - default = "4.13.3" + default = "3063.v26e24490f041" } # Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it diff --git a/make.ps1 b/make.ps1 index f4deb914..5ef398e7 100644 --- a/make.ps1 +++ b/make.ps1 @@ -5,7 +5,7 @@ Param( [String] $AdditionalArgs = '', [String] $Build = '', [String] $VersionTag = '4.11.2-1', - [String] $DockerAgentVersion = '4.11.2-1', + [String] $DockerAgentVersion = '3063.v26e24490f041-1', [switch] $PushVersions = $false ) From c47c410c85af564c9912217eb27d8eb2e6f1fcf0 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 23 Sep 2022 18:16:02 +0200 Subject: [PATCH 21/72] fix: only deploy to DockerHub on tag-triggered builds Signed-off-by: Damien Duportal --- Jenkinsfile | 191 ++++++++++++------------- docker-bake.hcl | 18 ++- tests/netcat-helper/Dockerfile-windows | 2 - 3 files changed, 108 insertions(+), 103 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95083555..a991ed59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,116 +6,115 @@ pipeline { timestamps() } - triggers { - pollSCM('H/24 * * * *') // once a day in case some hooks are missed - } - stages { - stage('Linux') { - agent { - label "docker&&linux" - } - options { - timeout(time: 30, unit: 'MINUTES') - } - environment { - JENKINS_REPO = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}/inbound-agent" - } - steps { - script { - def branchName = "${env.BRANCH_NAME}" - infra.withDockerCredentials { - if (branchName ==~ 'master') { - // publish the images to Dockerhub - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --push --file docker-bake.hcl linux - ''' - } else if (env.TAG_NAME == null) { - sh 'make build' - sh 'make test' - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --file docker-bake.hcl linux - ''' - } + stage('Build') { + parallel { + stage('Windows') { + options { + timeout(time: 60, unit: 'MINUTES') } - - if(env.TAG_NAME != null) { - def tagItems = env.TAG_NAME.split('-') - if(tagItems.length == 2) { - def remotingVersion = tagItems[0] - def buildNumber = tagItems[1] - // we need to build and publish the tag version - infra.withDockerCredentials { - sh """ - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - export REMOTING_VERSION=$remotingVersion - export BUILD_NUMBER=$buildNumber - export ON_TAG=true - docker buildx bake --push --file docker-bake.hcl linux - """ + environment { + DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" + } + stages { + stage('Build and Test') { + // This stage is the "CI" and should be run on all code changes triggered by a code change + when { + not { buildingTag() } + } + steps { + script { + def parallelBuilds = [:] + def images = ['jdk11-windowsservercore-ltsc2019', 'jdk11-nanoserver-1809', 'jdk17-windowsservercore-ltsc2019', 'jdk17-nanoserver-1809'] + for (unboundImage in images) { + def image = unboundImage // Bind variable before the closure + // Prepare a map of the steps to run in parallel + parallelBuilds[image] = { + // Allocate a node for each image to avoid filling disk + node('docker-windows') { + // Cleanup the Docker Engine if the machine is reused (to avoid harddrive being filled) + powershell 'docker.exe system prune --volumes --force' + checkout scm + powershell '& ./make.ps1 -Build ' + image + ' test' + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') + } + } + } + // Peform the parallel execution + parallel parallelBuilds + } + } + } + stage('Deploy to DockerHub') { + // This stage is the "CD" and should only be run when a tag triggered the build + when { + buildingTag() + } + steps { + script { + // This function is defined in the jenkins-infra/pipeline-library + infra.withDockerCredentials { + powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish" + } + } } } } } - } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') - } - } - } - - stage('Windows') { - matrix { - axes { - axis { - name 'IMAGE_NAME' - values 'jdk11-windowsservercore-ltsc2019', 'jdk11-nanoserver-1809', 'jdk17-windowsservercore-ltsc2019', 'jdk17-nanoserver-1809' + stage('Linux') { + agent { + label "docker&&linux" } - } - - stages { - stage('Build') { - agent { - label 'docker-windows' - } - options { - timeout(time: 60, unit: 'MINUTES') - } - environment { - DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" + options { + timeout(time: 30, unit: 'MINUTES') + } + environment { + JENKINS_REPO = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}/inbound-agent" + } + stages { + stage('Prepare Docker BuildX Runner for multi-arch') { + steps { + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + ''' + } } - steps { - powershell "& ./make.ps1 -Build ${env.IMAGE_NAME} test" - script { - def branchName = "${env.BRANCH_NAME}" - if (branchName ==~ 'master') { - // we can't use dockerhub builds for windows - // so we publish here - infra.withDockerCredentials { - powershell '& ./make.ps1 publish' - } + stage('Build and Test') { + // This stage is the "CI" and should be run on all code changes triggered by a code change + when { + not { buildingTag() } + } + steps { + sh 'make build' + sh 'make test' + // If the tests are passing for Linux AMD64, then we can build all the CPU architectures + sh 'docker buildx bake --file docker-bake.hcl linux' + } + post { + always { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') } - - def tagName = "${env.TAG_NAME}" - if(tagName =~ /\d(\.\d)+(-\d+)?/) { - // we need to build and publish the tagged version + } + } + stage('Deploy to DockerHub') { + // This stage is the "CD" and should only be run when a tag triggered the build + when { + buildingTag() + } + steps { + script { + // This function is defined in the jenkins-infra/pipeline-library infra.withDockerCredentials { - powershell "& ./make.ps1 -Build ${env.IMAGE_NAME} -PushVersions -VersionTag $tagName publish" + sh ''' + export IMAGE_TAG="${TAG_NAME}" + export ON_TAG=true + docker buildx bake --push --file docker-bake.hcl linux + ''' } } } } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') - } - } } } } diff --git a/docker-bake.hcl b/docker-bake.hcl index 4abb65a2..419aa15a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -22,7 +22,19 @@ group "linux-ppc64le" { targets = [] } -# update this to use a newer build number of the jenkins/agent image +variable "IMAGE_TAG" { + default = "3063.v26e24490f041-1" +} + +variable "REMOTING_VERSION" { + default = split("-", "${IMAGE_TAG}")[0] +} + +variable "BUILD_NUMBER" { + default = split("-", "${IMAGE_TAG}")[1] +} + +# update this to use a newer build number of the parent jenkins/agent image variable "AGENT_IMAGE_BUILD_NUMBER" { default = "1" } @@ -35,10 +47,6 @@ variable "JENKINS_REPO" { default = "jenkins/inbound-agent" } -variable "REMOTING_VERSION" { - default = "3063.v26e24490f041" -} - # Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it variable "BUILD_NUMBER" { default = "1" diff --git a/tests/netcat-helper/Dockerfile-windows b/tests/netcat-helper/Dockerfile-windows index c0ac2f05..d42d5244 100644 --- a/tests/netcat-helper/Dockerfile-windows +++ b/tests/netcat-helper/Dockerfile-windows @@ -36,5 +36,3 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl $proc = Start-Process "C:\nmap-install.exe" -PassThru -ArgumentList '/S' ; ` $proc.WaitForExit() ; ` Remove-Item -Path nmap-install.exe - - From e00c9351bca0128175df4668f15fd5cfb1689a5b Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 07:13:09 -0400 Subject: [PATCH 22/72] code review + cleanup Signed-off-by: Damien Duportal --- Jenkinsfile | 4 +--- docker-bake.hcl | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a991ed59..4b97793e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,8 +32,6 @@ pipeline { parallelBuilds[image] = { // Allocate a node for each image to avoid filling disk node('docker-windows') { - // Cleanup the Docker Engine if the machine is reused (to avoid harddrive being filled) - powershell 'docker.exe system prune --volumes --force' checkout scm powershell '& ./make.ps1 -Build ' + image + ' test' junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') @@ -72,7 +70,7 @@ pipeline { JENKINS_REPO = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}/inbound-agent" } stages { - stage('Prepare Docker BuildX Runner for multi-arch') { + stage('Prepare Docker') { steps { sh ''' docker buildx create --use diff --git a/docker-bake.hcl b/docker-bake.hcl index 419aa15a..615a1755 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -22,19 +22,18 @@ group "linux-ppc64le" { targets = [] } +#### This is the current (e.g. jenkins/inbound-agent) version (including build number suffix) variable "IMAGE_TAG" { default = "3063.v26e24490f041-1" } - variable "REMOTING_VERSION" { default = split("-", "${IMAGE_TAG}")[0] } - variable "BUILD_NUMBER" { default = split("-", "${IMAGE_TAG}")[1] } -# update this to use a newer build number of the parent jenkins/agent image +#### This is for the "parent" image to use: remoting version is interpolated from IMAGE_TAG) but parent image also have a build number suffix variable "AGENT_IMAGE_BUILD_NUMBER" { default = "1" } From 7ff44299b4f1c7778e86882f644c4533a3c17599 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 07:14:18 -0400 Subject: [PATCH 23/72] code review Signed-off-by: Damien Duportal --- docker-bake.hcl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 615a1755..a1493112 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -46,11 +46,6 @@ variable "JENKINS_REPO" { default = "jenkins/inbound-agent" } -# Used in the tag pushed to the jenkins/inbound-agent image, no need to update this the pipeline will change it -variable "BUILD_NUMBER" { - default = "1" -} - variable "ON_TAG" { default = "false" } From cd4ff6fcebe07dbc5af091eca4d6f772bff5cff6 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 15:26:39 +0200 Subject: [PATCH 24/72] chore(Release Drafter) switch to reusable action, use static draft name and allow manual execution --- .github/release-drafter.yml | 4 ++++ .github/workflows/changelog.yml | 17 ----------------- .github/workflows/release-drafter.yml | 12 +++--------- 3 files changed, 7 insertions(+), 26 deletions(-) create mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/changelog.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..364976e9 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +_extends: .github + +name-template: 'next' +tag-template: 'next' diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index ec7a7608..00000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Automates creation of Release Drafts using Release Drafter -# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc - -on: - push: - branches: - - master - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.11.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index f87134b2..16818710 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,17 +1,11 @@ -# Note: additional setup is required, see https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc - -name: Release Drafter +name: Release Drafter (Changelog) on: + workflow_dispatch: push: branches: - master jobs: update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into the default branch - - uses: release-drafter/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: jenkinsci/.github/.github/workflows/release-drafter.yml@master From f013c45f54a2fe3acae1eb864cc248e7c5cb064f Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 10:40:33 -0400 Subject: [PATCH 25/72] feat: bump remoting to 3063.v26e24490f041 (jenkins/agent with '-1') and prepare release 3063.v26e24490f041-1 for jenkins/inbound-agent Signed-off-by: Damien Duportal --- 11/alpine/Dockerfile | 4 ++-- 11/debian/Dockerfile | 4 ++-- 11/windows/nanoserver-1809/Dockerfile | 8 ++++---- 11/windows/windowsservercore-ltsc2019/Dockerfile | 6 +++--- 17/alpine/Dockerfile | 4 ++-- 17/debian/Dockerfile | 4 ++-- 17/windows/nanoserver-1809/Dockerfile | 8 ++++---- 17/windows/windowsservercore-ltsc2019/Dockerfile | 6 +++--- make.ps1 | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index e8e97c34..596b40b0 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -21,8 +21,8 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=latest-alpine-jdk11 -FROM jenkins/agent:$version +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-alpine-jdk11 ARG version LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" diff --git a/11/debian/Dockerfile b/11/debian/Dockerfile index 2143d69c..9a48c4ba 100644 --- a/11/debian/Dockerfile +++ b/11/debian/Dockerfile @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=4.9-1-jdk11 -FROM jenkins/agent:$version +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk11 ARG version LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index dade18aa..7568194b 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,11 +21,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-jdk11-nanoserver-1809 +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk11-nanoserver-1809 -ARG VERSION -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" +ARG version +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index e799522c..2f09d84e 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-jdk11-windowsservercore-ltsc2019 +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk11-windowsservercore-ltsc2019 -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index 52864fa9..6d8aaeb4 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -21,8 +21,8 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=latest-alpine-jdk17 -FROM jenkins/agent:$version +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-alpine-jdk17 ARG version LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 30afaaaa..1eee6877 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,5 +1,5 @@ -ARG version=4.13.3-2-jdk17 -FROM jenkins/agent:$version +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk17 ARG version LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index d759da67..0b9d3005 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,11 +21,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-jdk17-nanoserver-1809 +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk17-nanoserver-1809 -ARG VERSION -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" +ARG version +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index e22986c5..852b54dc 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG VERSION=4.9-1 -FROM jenkins/agent:${VERSION}-jdk17-windowsservercore-ltsc2019 +ARG version=3063.v26e24490f041-1 +FROM jenkins/agent:${version}-jdk17-windowsservercore-ltsc2019 -LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$VERSION" +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins diff --git a/make.ps1 b/make.ps1 index 5ef398e7..fb3d00c3 100644 --- a/make.ps1 +++ b/make.ps1 @@ -4,7 +4,7 @@ Param( [String] $Target = "build", [String] $AdditionalArgs = '', [String] $Build = '', - [String] $VersionTag = '4.11.2-1', + [String] $VersionTag = '3063.v26e24490f041-1', [String] $DockerAgentVersion = '3063.v26e24490f041-1', [switch] $PushVersions = $false ) From 5f6e523bb9fb7c10428ffeaec47b8b6633b6b17e Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 11:00:49 -0400 Subject: [PATCH 26/72] fixup Signed-off-by: Damien Duportal --- docker-bake.hcl | 12 ++++++------ make.ps1 | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index a1493112..cd9fef8d 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -34,8 +34,8 @@ variable "BUILD_NUMBER" { } #### This is for the "parent" image to use: remoting version is interpolated from IMAGE_TAG) but parent image also have a build number suffix -variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "1" +variable "PARENT_IMAGE_VERSION" { + default = "${REMOTING_VERSION}-1" } variable "REGISTRY" { @@ -54,7 +54,7 @@ target "alpine_jdk11" { dockerfile = "11/alpine/Dockerfile" context = "." args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-alpine-jdk11" + version = "${PARENT_IMAGE_VERSION}" } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine": "", @@ -71,7 +71,7 @@ target "alpine_jdk17" { dockerfile = "17/alpine/Dockerfile" context = "." args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-alpine-jdk17" + version = "${PARENT_IMAGE_VERSION}" } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17": "", @@ -85,7 +85,7 @@ target "debian_jdk11" { dockerfile = "11/debian/Dockerfile" context = "." args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk11" + version = "${PARENT_IMAGE_VERSION}" } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}": "", @@ -101,7 +101,7 @@ target "debian_jdk17" { dockerfile = "17/debian/Dockerfile" context = "." args = { - version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk17" + version = "${PARENT_IMAGE_VERSION}" } tags = [ equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17": "", diff --git a/make.ps1 b/make.ps1 index fb3d00c3..a549d207 100644 --- a/make.ps1 +++ b/make.ps1 @@ -48,7 +48,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) foreach($tag in $builds[$Build]['Tags']) { Copy-Item -Path 'jenkins-agent.ps1' -Destination (Join-Path $builds[$Build]['Folder'] 'jenkins-agent.ps1') -Force Write-Host "Building $Build => tag=$tag" - $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$Build]['Folder'] + $cmd = "docker build --build-arg 'version={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd $exitCodes += $lastExitCode @@ -58,7 +58,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) $buildTag = "$VersionTag" } Write-Host "Building $Build => tag=$buildTag" - $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$Build]['Folder'] + $cmd = "docker build --build-arg 'version={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$Build]['Folder'] Invoke-Expression $cmd $exitCodes += $lastExitCode } @@ -68,7 +68,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) Copy-Item -Path 'jenkins-agent.ps1' -Destination (Join-Path $builds[$b]['Folder'] 'jenkins-agent.ps1') -Force foreach($tag in $builds[$b]['Tags']) { Write-Host "Building $b => tag=$tag" - $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$b]['Folder'] + $cmd = "docker build --build-arg 'version={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $tag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd $exitCodes += $lastExitCode @@ -78,7 +78,7 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build) $buildTag = "$VersionTag" } Write-Host "Building $Build => tag=$buildTag" - $cmd = "docker build --build-arg 'VERSION={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$b]['Folder'] + $cmd = "docker build --build-arg 'version={0}' -t {1}/{2}:{3} {4} {5}" -f $DockerAgentVersion, $Organization, $Repository, $buildTag, $AdditionalArgs, $builds[$b]['Folder'] Invoke-Expression $cmd $exitCodes += $lastExitCode } From e4f2439179e16697b224000f34385ec6ae1dccb1 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 11:28:29 -0400 Subject: [PATCH 27/72] fixup Signed-off-by: Damien Duportal --- tests/inboundAgent.Tests.ps1 | 7 +------ tests/tests.bats | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/inboundAgent.Tests.ps1 b/tests/inboundAgent.Tests.ps1 index c7cad3f0..55b870ba 100644 --- a/tests/inboundAgent.Tests.ps1 +++ b/tests/inboundAgent.Tests.ps1 @@ -129,13 +129,8 @@ Describe "[$global:JDK $global:FLAVOR] build args" { BeforeAll { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." # an old jdk11 image version - $TEST_VERSION="4.7" + $TEST_VERSION="3063.v26e24490f041" $DOCKER_AGENT_VERSION_SUFFIX="1" - if($global:JDK -eq '17') { - # the first jdk17 images for Windows - $TEST_VERSION = "4.10" - $DOCKER_AGENT_VERSION_SUFFIX="7" - } $TEST_USER="foo" $ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" } diff --git a/tests/tests.bats b/tests/tests.bats index acec4a38..13b81580 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -46,8 +46,8 @@ SUT_IMAGE=$(get_sut_image) cd "${BATS_TEST_DIRNAME}"/.. || false local ARG_TEST_VERSION - local TEST_VERSION="4.3" - local DOCKER_AGENT_VERSION_SUFFIX="4" + local TEST_VERSION="3063.v26e24490f041" + local DOCKER_AGENT_VERSION_SUFFIX="1" local TEST_USER="root" local ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" From 956c41591653398aee00eff61473d9d6255d1273 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 13:03:23 -0400 Subject: [PATCH 28/72] hotfix(windows) fix deploy error on the pipeline Signed-off-by: Damien Duportal --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4b97793e..6a8276d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,6 +44,9 @@ pipeline { } } stage('Deploy to DockerHub') { + agent { + label 'docker-windows' + } // This stage is the "CD" and should only be run when a tag triggered the build when { buildingTag() From bbac7646ce4c06531ddeb08f8d105d2679f52828 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 17:42:23 -0400 Subject: [PATCH 29/72] hotfix(windows) correct pipeline error when deploying Signed-off-by: Damien Duportal --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6a8276d0..be119b85 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,7 +55,7 @@ pipeline { script { // This function is defined in the jenkins-infra/pipeline-library infra.withDockerCredentials { - powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish" + powershell '& ./make.ps1 -PushVersions -VersionTag $env:TAG_NAME publish' } } } From c7da3c7d8dec6260bb42ec1c97015caf990c0917 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 29 Sep 2022 12:52:58 -0400 Subject: [PATCH 30/72] chore(test) fix build argument tests by using an old version Signed-off-by: Damien Duportal --- tests/inboundAgent.Tests.ps1 | 7 ++++--- tests/tests.bats | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/inboundAgent.Tests.ps1 b/tests/inboundAgent.Tests.ps1 index 55b870ba..3bd65439 100644 --- a/tests/inboundAgent.Tests.ps1 +++ b/tests/inboundAgent.Tests.ps1 @@ -128,15 +128,16 @@ Describe "[$global:JDK $global:FLAVOR] image starts jenkins-agent.ps1 correctly Describe "[$global:JDK $global:FLAVOR] build args" { BeforeAll { Push-Location -StackName 'agent' -Path "$PSScriptRoot/.." - # an old jdk11 image version - $TEST_VERSION="3063.v26e24490f041" + # Old version used to test overriding the build arguments. + # This old version must have the same tag suffixes as the current 4 windows images (`-jdk11-nanoserver` etc.) + $TEST_VERSION="3046.v38db_38a_b_7a_86" $DOCKER_AGENT_VERSION_SUFFIX="1" $TEST_USER="foo" $ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" } It 'builds image with arguments' { - $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=${ARG_TEST_VERSION} --build-arg user=$TEST_USER -t $global:AGENT_IMAGE $global:FOLDER" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg version=${ARG_TEST_VERSION} --build-arg user=$TEST_USER -t $global:AGENT_IMAGE $global:FOLDER" $exitCode | Should -Be 0 $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --name $global:AGENT_CONTAINER -P $global:AGENT_IMAGE -Cmd $global:SHELL" diff --git a/tests/tests.bats b/tests/tests.bats index 13b81580..9a73a470 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -45,11 +45,14 @@ SUT_IMAGE=$(get_sut_image) @test "[${SUT_IMAGE}] use build args correctly" { cd "${BATS_TEST_DIRNAME}"/.. || false - local ARG_TEST_VERSION - local TEST_VERSION="3063.v26e24490f041" + # Old version used to test overriding the build arguments. + # This old version must have the same tag suffixes as the ones defined in the docker-bake file (`-jdk17`, `jdk11`, etc.) + local TEST_VERSION="3046.v38db_38a_b_7a_86" local DOCKER_AGENT_VERSION_SUFFIX="1" - local TEST_USER="root" + local ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" + local TEST_USER="root" + local FOLDER=$(get_dockerfile_directory) From d1fbedc4181c0f0ff6dc597c9f517f0a904d178b Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 7 Oct 2022 10:04:21 -0600 Subject: [PATCH 31/72] Drop ppc64le support IBM no longer provides the PowerPC agents that we use to test and verify PowerPC support. Can't support an architecture that we can't test. --- Makefile | 4 ++-- docker-bake.hcl | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ef6424c0..293757ae 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ export DOCKER_CLI_EXPERIMENTAL=enabled export BUILDKIT_PROGRESS=plain current_arch := $(shell uname -m) -export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (i386) echo "386";; (aarch64|arm64) echo "arm64" ;; (armv6*) echo "arm/v6";; (armv7*) echo "arm/v7";; (ppc64*|s390*|riscv*) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) +export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (i386) echo "386";; (aarch64|arm64) echo "arm64" ;; (armv6*) echo "arm/v6";; (armv7*) echo "arm/v7";; (s390*|riscv*) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) # Set to the path of a specific test suite to restrict execution only to this # default is "all test suites in the "tests/" directory @@ -89,4 +89,4 @@ test-%: prepare-test sh -c "npm install tap-xunit -g && cat target/results-$*.tap | tap-xunit --package='jenkinsci.docker.$*' > target/junit-results-$*.xml" test: prepare-test - @make --silent list | while read image; do make --silent "test-$${image}"; done \ No newline at end of file + @make --silent list | while read image; do make --silent "test-$${image}"; done diff --git a/docker-bake.hcl b/docker-bake.hcl index cd9fef8d..766e7935 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -18,10 +18,6 @@ group "linux-s390x" { targets = [] } -group "linux-ppc64le" { - targets = [] -} - #### This is the current (e.g. jenkins/inbound-agent) version (including build number suffix) variable "IMAGE_TAG" { default = "3063.v26e24490f041-1" From d53f770adab1f50f7309fae750e7e7ef88ef1336 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 7 Oct 2022 11:26:48 -0600 Subject: [PATCH 32/72] Do not check Java 8 dependencies No more Java 8 support in this branch --- .github/dependabot.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0b9b9d83..561bb1f0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,28 +15,3 @@ updates: schedule: interval: weekly open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/8/windows/nanoserver-1809" - schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/8/windows/windowsservercore-1809" - schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/8/windows/windowsservercore-ltsc2019" - schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/8/debian" - schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/8/alpine" - schedule: - interval: weekly - open-pull-requests-limit: 10 From 294df0076fea87a40d8b11d91c8cf985be2da4cf Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Mon, 31 Oct 2022 08:12:35 +0100 Subject: [PATCH 33/72] Bump remoting to `3071.v7e9b 0dc08466` (both parent image tag and incoming release to `3071.v7e9b 0dc08466-1`) (#293) --- 11/alpine/Dockerfile | 2 +- 11/debian/Dockerfile | 2 +- 11/windows/nanoserver-1809/Dockerfile | 2 +- .../windowsservercore-ltsc2019/Dockerfile | 2 +- 17/alpine/Dockerfile | 2 +- 17/debian/Dockerfile | 2 +- 17/windows/nanoserver-1809/Dockerfile | 2 +- .../windowsservercore-ltsc2019/Dockerfile | 2 +- Makefile | 2 +- docker-bake.hcl | 26 +++++++------------ make.ps1 | 4 +-- 11 files changed, 21 insertions(+), 27 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index 596b40b0..d732606d 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -21,7 +21,7 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-alpine-jdk11 ARG version diff --git a/11/debian/Dockerfile b/11/debian/Dockerfile index 9a48c4ba..94a96d13 100644 --- a/11/debian/Dockerfile +++ b/11/debian/Dockerfile @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk11 ARG version diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index 7568194b..a2aae40c 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk11-nanoserver-1809 ARG version diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 2f09d84e..eb6475fc 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk11-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index 6d8aaeb4..8788b228 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -21,7 +21,7 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-alpine-jdk17 ARG version diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 1eee6877..787c7256 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,4 +1,4 @@ -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk17 ARG version diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index 0b9d3005..f5e68ebf 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk17-nanoserver-1809 ARG version diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index 852b54dc..ffcc0e9d 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3063.v26e24490f041-1 +ARG version=3071.v7e9b_0dc08466-1 FROM jenkins/agent:${version}-jdk17-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" diff --git a/Makefile b/Makefile index 293757ae..eb8938cb 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ list: check-reqs bats: git clone https://github.com/bats-core/bats-core bats ;\ cd bats ;\ - git checkout v1.4.1 + git checkout v1.8.2 prepare-test: bats check-reqs git submodule update --init --recursive diff --git a/docker-bake.hcl b/docker-bake.hcl index 766e7935..c74c2770 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -18,20 +18,14 @@ group "linux-s390x" { targets = [] } -#### This is the current (e.g. jenkins/inbound-agent) version (including build number suffix) +#### This is the current (e.g. jenkins/inbound-agent) version (including build number suffix). Overridden by release builds from GIT_TAG. variable "IMAGE_TAG" { - default = "3063.v26e24490f041-1" -} -variable "REMOTING_VERSION" { - default = split("-", "${IMAGE_TAG}")[0] -} -variable "BUILD_NUMBER" { - default = split("-", "${IMAGE_TAG}")[1] + default = "3071.v7e9b_0dc08466-1" } -#### This is for the "parent" image to use: remoting version is interpolated from IMAGE_TAG) but parent image also have a build number suffix +#### This is for the "parent" image version to use (jenkins/agent:-) variable "PARENT_IMAGE_VERSION" { - default = "${REMOTING_VERSION}-1" + default = "3071.v7e9b_0dc08466-1" } variable "REGISTRY" { @@ -53,8 +47,8 @@ target "alpine_jdk11" { version = "${PARENT_IMAGE_VERSION}" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk11": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine-jdk11": "", "${REGISTRY}/${JENKINS_REPO}:alpine", "${REGISTRY}/${JENKINS_REPO}:alpine-jdk11", "${REGISTRY}/${JENKINS_REPO}:latest-alpine", @@ -70,7 +64,7 @@ target "alpine_jdk17" { version = "${PARENT_IMAGE_VERSION}" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine-jdk17": "", "${REGISTRY}/${JENKINS_REPO}:alpine-jdk17", "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17", ] @@ -84,8 +78,8 @@ target "debian_jdk11" { version = "${PARENT_IMAGE_VERSION}" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk11": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-jdk11": "", "${REGISTRY}/${JENKINS_REPO}:jdk11", "${REGISTRY}/${JENKINS_REPO}:latest", "${REGISTRY}/${JENKINS_REPO}:latest-jdk11", @@ -100,7 +94,7 @@ target "debian_jdk17" { version = "${PARENT_IMAGE_VERSION}" } tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17": "", + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-jdk17": "", "${REGISTRY}/${JENKINS_REPO}:jdk17", "${REGISTRY}/${JENKINS_REPO}:latest-jdk17", ] diff --git a/make.ps1 b/make.ps1 index a549d207..5ed030b0 100644 --- a/make.ps1 +++ b/make.ps1 @@ -4,8 +4,8 @@ Param( [String] $Target = "build", [String] $AdditionalArgs = '', [String] $Build = '', - [String] $VersionTag = '3063.v26e24490f041-1', - [String] $DockerAgentVersion = '3063.v26e24490f041-1', + [String] $VersionTag = '3071.v7e9b_0dc08466-1', + [String] $DockerAgentVersion = '3071.v7e9b_0dc08466-1', [switch] $PushVersions = $false ) From 8a1a06b9dbfa695bab5bb7327835a806a65eb0c8 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 11 Nov 2022 10:32:10 +0100 Subject: [PATCH 34/72] chore(updatecli) add a manifest to track the parent image version Signed-off-by: Damien Duportal --- .github/dependabot.yml | 23 +- .github/workflows/updatecli.yaml | 29 +++ .../updatecli.d/jenkins-agent-parent.yaml | 216 ++++++++++++++++++ updatecli/values.github-action.yaml | 8 + 4 files changed, 262 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/updatecli.yaml create mode 100644 updatecli/updatecli.d/jenkins-agent-parent.yaml create mode 100644 updatecli/values.github-action.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 561bb1f0..0aa04a67 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,12 @@ +# Per https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: -- package-ecosystem: docker - directory: "/11/windows/windowsservercore-ltsc2019" + +# GitHub actions + +- package-ecosystem: "github-actions" + target-branch: master + directory: "/" schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/11/windows/nanoserver-1809" - schedule: - interval: weekly - open-pull-requests-limit: 10 -- package-ecosystem: docker - directory: "/11/debian" - schedule: - interval: weekly - open-pull-requests-limit: 10 + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml new file mode 100644 index 00000000..e92d03ab --- /dev/null +++ b/.github/workflows/updatecli.yaml @@ -0,0 +1,29 @@ +name: updatecli +on: + # Allow to be run manually + workflow_dispatch: + schedule: + # Run once per week (to avoid alert fatigue) + - cron: '0 2 * * 1' # Every Monday at 2am UTC + push: + pull_request: +jobs: + updatecli: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Updatecli in the runner + uses: updatecli/updatecli-action@v2.13.0 + + - name: Run Updatecli in Dry Run mode + run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml + env: + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Updatecli in Apply mode + if: github.ref == 'refs/heads/master' + run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml + env: + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/updatecli/updatecli.d/jenkins-agent-parent.yaml b/updatecli/updatecli.d/jenkins-agent-parent.yaml new file mode 100644 index 00000000..39e81ba1 --- /dev/null +++ b/updatecli/updatecli.d/jenkins-agent-parent.yaml @@ -0,0 +1,216 @@ +--- +name: Bump the parent image `jenkins/agent` version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastVersion: + kind: githubrelease + name: Get the latest version of the parent image `jenkins/agent` + spec: + owner: jenkinsci + repository: docker-agent + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionfilter: + kind: latest + +conditions: + checkJdk11AlpineDockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-alpine-jdk11" for linux/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-alpine-jdk11' + checkJdk17AlpineDockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-alpine-jdk17" for linux/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-alpine-jdk17' + checkJdk11DebianAmd64DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11" for linux/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11' + checkJdk11DebianArm64DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11" for linux/arm64 is available + disablesourceinput: true + spec: + architecture: arm64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11' + checkJdk11DebianArmv7DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11" for linux/arm/v7 is available + disablesourceinput: true + spec: + architecture: arm/v7 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11' + checkJdk11DebianS390xDockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11" for linux/s390x is available + disablesourceinput: true + spec: + architecture: s390x + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11' + checkJdk17DebianAmd64DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk17" for linux/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk17' + checkJdk17DebianArm64DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk17" for linux/arm64 is available + disablesourceinput: true + spec: + architecture: arm64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk17' + checkJdk17DebianArmv7DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk17" for linux/arm/v7 is available + disablesourceinput: true + spec: + architecture: arm/v7 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk17' + checkJdk11WindowsNanoserver1809DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11-nanoserver-1809" for windows/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11-nanoserver-1809' + checkJdk17WindowsNanoserver1809DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk17-nanoserver-1809" for windows/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk17-nanoserver-1809' + checkJdk11WindowsServer2019DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk11-windowsservercore-ltsc2019" for windows/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk11-windowsservercore-ltsc2019' + checkJdk17WindowsServer2019DockerImage: + kind: dockerimage + name: Check if the container image "jenkins/agent:-jdk17-windowsservercore-ltsc2019" for windows/amd64 is available + disablesourceinput: true + spec: + architecture: amd64 + image: jenkins/agent + tag: '{{source "lastVersion" }}-jdk17-windowsservercore-ltsc2019' + +targets: + setJdk11AlpineDockerImage: + name: Bump the parent image `jenkins/agent` version on JDK11 Alpine + kind: dockerfile + spec: + file: 11/alpine/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk11DebianDockerImage: + name: Bump the parent image `jenkins/agent` version on JDK11 Debian + kind: dockerfile + spec: + file: 11/alpine/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk11WindowsNanoserver1809DockerImage: + name: Bump the parent image `jenkins/agent` version on JDK11 Windows Nanoserver 1809 + kind: dockerfile + spec: + file: 11/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk11WindowsServer2019DockerImage: + name: Bump the parent image `jenkins/agent` version on JDK11 Windows Server 2019 + kind: dockerfile + spec: + file: 11/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk17AlpineDockerImage: + name: Bump the parent image `jenkins/agent` version on JDK17 Alpine + kind: dockerfile + spec: + file: 17/alpine/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk17DebianDockerImage: + name: Bump the parent image `jenkins/agent` version on JDK17 Debian + kind: dockerfile + spec: + file: 17/alpine/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk17WindowsNanoserver1809DockerImage: + name: Bump the parent image `jenkins/agent` version on JDK17 Windows Nanoserver 1809 + kind: dockerfile + spec: + file: 17/windows/nanoserver-1809/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + setJdk17WindowsServer2019DockerImage: + name: Bump the parent image `jenkins/agent` version on JDK17 Windows Server 2019 + kind: dockerfile + spec: + file: 17/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: version + scmid: default + +pullrequests: + default: + kind: github + scmid: default + title: Bump the parent image `jenkins/agent` version to {{ source "lastVersion" }} + spec: + labels: + - dependencies + - jenkins/agent diff --git a/updatecli/values.github-action.yaml b/updatecli/values.github-action.yaml new file mode 100644 index 00000000..3fb8de4d --- /dev/null +++ b/updatecli/values.github-action.yaml @@ -0,0 +1,8 @@ +github: + user: "GitHub Actions" + email: "41898282+github-actions[bot]@users.noreply.github.com" + username: "github-actions" + token: "UPDATECLI_GITHUB_TOKEN" + branch: "master" + owner: "jenkinsci" + repository: "docker-inbound-agent" From e5bdca02201c7b08f27c246ef2ad909ef1555417 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Fri, 11 Nov 2022 10:43:55 +0100 Subject: [PATCH 35/72] fixup Signed-off-by: Damien Duportal --- .../updatecli.d/jenkins-agent-parent.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/updatecli/updatecli.d/jenkins-agent-parent.yaml b/updatecli/updatecli.d/jenkins-agent-parent.yaml index 39e81ba1..17215a8a 100644 --- a/updatecli/updatecli.d/jenkins-agent-parent.yaml +++ b/updatecli/updatecli.d/jenkins-agent-parent.yaml @@ -204,6 +204,26 @@ targets: keyword: ARG matcher: version scmid: default + setDockerBakeDefaultParentImage: + name: Bump the parent image `jenkins/agent` version on the docker-bake.hcl file + kind: file + spec: + file: docker-bake.hcl + matchpattern: >- + variable(.*)"PARENT_IMAGE_VERSION"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*) + replacepattern: >- + variable${1}"PARENT_IMAGE_VERSION"${2}{${3}${4}${5}default${6}= "{{ source "lastVersion" }}" + scmid: default + setWindowsMakePwshParentImage: + name: Bump the parent image `jenkins/agent` version on the windows make.ps1 file + kind: file + spec: + file: make.ps1 + matchpattern: >- + \$DockerAgentVersion(.*)=(.*), + replacepattern: >- + $$DockerAgentVersion${1}= '{{ source "lastVersion" }}', + scmid: default pullrequests: default: From f318f70de1a79d1f57d14119bb73f79e2ef887f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 12:21:40 +0000 Subject: [PATCH 36/72] Bump updatecli/updatecli-action from 2.13.0 to 2.14.0 Bumps [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) from 2.13.0 to 2.14.0. - [Release notes](https://github.com/updatecli/updatecli-action/releases) - [Commits](https://github.com/updatecli/updatecli-action/compare/v2.13.0...v2.14.0) --- updated-dependencies: - dependency-name: updatecli/updatecli-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/updatecli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index e92d03ab..97b0793e 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v2 - name: Install Updatecli in the runner - uses: updatecli/updatecli-action@v2.13.0 + uses: updatecli/updatecli-action@v2.14.0 - name: Run Updatecli in Dry Run mode run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml From 8e3b7f69f1a5ccd99d0288112b951e3e562c892c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 12:21:43 +0000 Subject: [PATCH 37/72] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/updatecli.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index 97b0793e..cb2063ae 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Updatecli in the runner uses: updatecli/updatecli-action@v2.14.0 From 8c7c6c128333328b0f6d2e07e47bc4efcee35fac Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 12 Nov 2022 10:36:16 +0100 Subject: [PATCH 38/72] chore(linux tests) apply shellcheck and fix concurency issues Signed-off-by: Damien Duportal --- tests/test_helpers.bash | 17 ++++-------- tests/tests.bats | 61 +++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/tests/test_helpers.bash b/tests/test_helpers.bash index 18485919..2f6c09eb 100755 --- a/tests/test_helpers.bash +++ b/tests/test_helpers.bash @@ -8,7 +8,7 @@ set -eu )>&2 function printMessage { - echo "# ${@}" >&3 + echo "# ${*}" >&3 } # Assert that $1 is the output of a command $2 @@ -56,28 +56,21 @@ function get_sut_image { make --silent show | jq -r ".target.${IMAGE}.tags[0]" } -function get_dockerfile_directory() { - test -n "${IMAGE:?"[sut_image] Please set the variable 'IMAGE' to the name of the image to test in 'docker-bake.hcl'."}" - - DOCKERFILE=$(make --silent show | jq -r ".target.${IMAGE}.dockerfile") - echo "${DOCKERFILE%"/Dockerfile"}" -} - function clean_test_container { docker kill "${AGENT_CONTAINER}" "${NETCAT_HELPER_CONTAINER}" &>/dev/null || : docker rm -fv "${AGENT_CONTAINER}" "${NETCAT_HELPER_CONTAINER}" &>/dev/null || : } function is_agent_container_running { - local cid="${1}" + local cid="${1}" sleep 1 retry 3 1 assert "true" docker inspect -f '{{.State.Running}}' "${cid}" } function buildNetcatImage() { - if ! docker inspect --type=image netcat-helper:latest &>/dev/null; then - docker build -t netcat-helper:latest tests/netcat-helper/ &>/dev/null - fi + if ! docker inspect --type=image netcat-helper:latest &>/dev/null; then + docker build -t netcat-helper:latest tests/netcat-helper/ &>/dev/null + fi } function cleanup { diff --git a/tests/tests.bats b/tests/tests.bats index 9a73a470..f4773911 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -1,80 +1,81 @@ #!/usr/bin/env bats AGENT_CONTAINER=bats-jenkins-jnlp-agent -NETCAT_HELPER_CONTAINER=netcat-helper load test_helpers buildNetcatImage -SUT_IMAGE=$(get_sut_image) +SUT_IMAGE="$(get_sut_image)" @test "[${SUT_IMAGE}] image has installed jenkins-agent in PATH" { - cid=$(docker run -d -it -P "${SUT_IMAGE}" /bin/bash) + local sut_cid + sut_cid="$(docker run -d -it -P "${SUT_IMAGE}" /bin/bash)" - is_agent_container_running $cid + is_agent_container_running "${sut_cid}" - run docker exec "${cid}" which jenkins-agent + run docker exec "${sut_cid}" which jenkins-agent [ "/usr/local/bin/jenkins-agent" = "${lines[0]}" ] - run docker exec "${cid}" which jenkins-agent + run docker exec "${sut_cid}" which jenkins-agent [ "/usr/local/bin/jenkins-agent" = "${lines[0]}" ] - cleanup $cid + cleanup "${sut_cid}" } @test "[${SUT_IMAGE}] image starts jenkins-agent correctly (slow test)" { - # Spin off a helper image which contains netcat - netcat_cid=$(docker run -d -it --name netcat-helper netcat-helper:latest /bin/sh) + local netcat_cid sut_cid + # Spin off a helper image which launches the netcat utility, listening at port 5000 for 30 sec + netcat_cid="$(docker run -d -it netcat-helper:latest /bin/sh -c "timeout 30s nc -l 5000")" # Run jenkins agent which tries to connect to the netcat-helper container at port 5000 - cid=$(docker run -d --link netcat-helper "${SUT_IMAGE}" -url http://netcat-helper:5000 aaa bbb) + sut_cid="$(docker run -d --link "${netcat_cid}" "${SUT_IMAGE}" -url "http://${netcat_cid}:5000" aaa bbb)" - # Launch the netcat utility, listening at port 5000 for 30 sec - # bats will capture the output from netcat and compare the first line + # Wait for the whole process to take place (in resource-constrained environments it can take 100s of milliseconds) + sleep 1 + + # Capture the logs output from netcat and compare the first line # of the header of the first HTTP request with the expected one - run docker exec netcat-helper /bin/sh -c "timeout 30s nc -l 5000" + run docker logs "${netcat_cid}" - # The GET request ends with a '\r' - [ $'GET /tcpSlaveAgentListener/ HTTP/1.1\r' = "${lines[0]}" ] + [[ "${lines[0]}" = *"GET /tcpSlaveAgentListener/ HTTP/1.1"* ]] - cleanup $netcat_cid - cleanup $cid + cleanup "${netcat_cid}" + cleanup "${sut_cid}" } @test "[${SUT_IMAGE}] use build args correctly" { cd "${BATS_TEST_DIRNAME}"/.. || false + local TEST_VERSION DOCKER_AGENT_VERSION_SUFFIX ARG_TEST_VERSION TEST_USER sut_image sut_cid + # Old version used to test overriding the build arguments. # This old version must have the same tag suffixes as the ones defined in the docker-bake file (`-jdk17`, `jdk11`, etc.) - local TEST_VERSION="3046.v38db_38a_b_7a_86" - local DOCKER_AGENT_VERSION_SUFFIX="1" - - local ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" - local TEST_USER="root" - + TEST_VERSION="3046.v38db_38a_b_7a_86" + DOCKER_AGENT_VERSION_SUFFIX="1" - local FOLDER=$(get_dockerfile_directory) + ARG_TEST_VERSION="${TEST_VERSION}-${DOCKER_AGENT_VERSION_SUFFIX}" + TEST_USER="root" - local sut_image="${SUT_IMAGE}-tests-${BATS_TEST_NUMBER}" + sut_image="${SUT_IMAGE}-tests-${BATS_TEST_NUMBER}" docker buildx bake \ --set "${IMAGE}".args.version="${ARG_TEST_VERSION}" \ --set "${IMAGE}".args.user="${TEST_USER}" \ - --set "${IMAGE}".platform="linux/${ARCH}" \ + --set "${IMAGE}".platform=linux/"${ARCH}" \ --set "${IMAGE}".tags="${sut_image}" \ --load \ "${IMAGE}" - cid=$(docker run -d -it --name "${AGENT_CONTAINER}" -P "${sut_image}" /bin/sh) + sut_cid="$(docker run -d -it --name "${AGENT_CONTAINER}" -P "${sut_image}" /bin/sh)" - is_agent_container_running $cid + is_agent_container_running "${sut_cid}" - run docker exec "${cid}" sh -c "java -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -version" + run docker exec "${sut_cid}" sh -c "java -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -version" [ "${TEST_VERSION}" = "${lines[0]}" ] run docker exec "${AGENT_CONTAINER}" sh -c "id -u -n ${TEST_USER}" [ "${TEST_USER}" = "${lines[0]}" ] - cleanup $cid + cleanup "${sut_cid}" } From 0d2e4771c3140b63f888723eefb17eadf2ba1e1c Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 12 Nov 2022 20:32:19 +0100 Subject: [PATCH 39/72] fixup Signed-off-by: Damien Duportal --- tests/tests.bats | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/tests.bats b/tests/tests.bats index f4773911..fd4633e9 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -32,13 +32,11 @@ SUT_IMAGE="$(get_sut_image)" sut_cid="$(docker run -d --link "${netcat_cid}" "${SUT_IMAGE}" -url "http://${netcat_cid}:5000" aaa bbb)" # Wait for the whole process to take place (in resource-constrained environments it can take 100s of milliseconds) - sleep 1 + sleep 5 - # Capture the logs output from netcat and compare the first line - # of the header of the first HTTP request with the expected one + # Capture the logs output from netcat and check the header of the first HTTP request with the expected one run docker logs "${netcat_cid}" - - [[ "${lines[0]}" = *"GET /tcpSlaveAgentListener/ HTTP/1.1"* ]] + echo "${output}" | grep 'GET /tcpSlaveAgentListener/ HTTP/1.1' cleanup "${netcat_cid}" cleanup "${sut_cid}" From ed10d1f7311ef2f07771df9d7e7c31707bfa65af Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 17 Nov 2022 19:02:34 +0100 Subject: [PATCH 40/72] chore(updateci) hotfix on the parent-image manifest --- updatecli/updatecli.d/jenkins-agent-parent.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/updatecli.d/jenkins-agent-parent.yaml b/updatecli/updatecli.d/jenkins-agent-parent.yaml index 17215a8a..a51589cd 100644 --- a/updatecli/updatecli.d/jenkins-agent-parent.yaml +++ b/updatecli/updatecli.d/jenkins-agent-parent.yaml @@ -145,7 +145,7 @@ targets: name: Bump the parent image `jenkins/agent` version on JDK11 Debian kind: dockerfile spec: - file: 11/alpine/Dockerfile + file: 11/debian/Dockerfile instruction: keyword: ARG matcher: version @@ -181,7 +181,7 @@ targets: name: Bump the parent image `jenkins/agent` version on JDK17 Debian kind: dockerfile spec: - file: 17/alpine/Dockerfile + file: 17/debian/Dockerfile instruction: keyword: ARG matcher: version From 762d1c5d3874fc30e4f698a9d01aed7e4a72b312 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:18 +0000 Subject: [PATCH 41/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index eb6475fc..43349f6f 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk11-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From 1e8af14f3f070ad2fc64089e95274c7bed8a1937 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:19 +0000 Subject: [PATCH 42/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index f5e68ebf..b991da24 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk17-nanoserver-1809 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From 129ebc617c8e51be05598c1c25c653b32a3c2742 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:20 +0000 Subject: [PATCH 43/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 11/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/debian/Dockerfile b/11/debian/Dockerfile index 94a96d13..e1d88d37 100644 --- a/11/debian/Dockerfile +++ b/11/debian/Dockerfile @@ -20,10 +20,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk11 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From f910d82d6c18d723e118887b08b5bae08f745078 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:21 +0000 Subject: [PATCH 44/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index ffcc0e9d..f2141290 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk17-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From 94b9aeb47a1da4a96d1bc91baa8ffcc3d546c2cf Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:22 +0000 Subject: [PATCH 45/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index a2aae40c..e02f3118 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk11-nanoserver-1809 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From 359bde0237d985bb90875c0670dd284978500e99 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:22 +0000 Subject: [PATCH 46/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 11/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index d732606d..d1a217d8 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-alpine-jdk11 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 888f4dae6a79d3439a9d50bb4af8b70b27d7957e Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:23 +0000 Subject: [PATCH 47/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- make.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.ps1 b/make.ps1 index 5ed030b0..89cb4901 100644 --- a/make.ps1 +++ b/make.ps1 @@ -5,7 +5,7 @@ Param( [String] $AdditionalArgs = '', [String] $Build = '', [String] $VersionTag = '3071.v7e9b_0dc08466-1', - [String] $DockerAgentVersion = '3071.v7e9b_0dc08466-1', + [String] $DockerAgentVersion = '3071.v7e9b_0dc08466-5', [switch] $PushVersions = $false ) From 1595958203e986bd10b929fcb68ae641294646ba Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:24 +0000 Subject: [PATCH 48/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index c74c2770..7439907e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -25,7 +25,7 @@ variable "IMAGE_TAG" { #### This is for the "parent" image version to use (jenkins/agent:-) variable "PARENT_IMAGE_VERSION" { - default = "3071.v7e9b_0dc08466-1" + default = "3071.v7e9b_0dc08466-5" } variable "REGISTRY" { From e59a1ef7886b9776fb61d7faf16cfd405c3a8094 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:25 +0000 Subject: [PATCH 49/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 17/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index 8788b228..65b8505c 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-alpine-jdk17 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 5bb3d40be88aa262e404edb47318948fa707ea93 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:01:27 +0000 Subject: [PATCH 50/72] chore: changed lines [24] of file "/tmp/updatecli/github/jenkinsci/dock... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... er-inbound-agent/11/windows/windowsservercore-ltsc2019/Dockerfile" Made with ❤️️ by updatecli --- 17/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 787c7256..04d971f4 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,7 +1,7 @@ -ARG version=3071.v7e9b_0dc08466-1 +ARG version=3071.v7e9b_0dc08466-5 FROM jenkins/agent:${version}-jdk17 -ARG version +ARG version=3071.v7e9b_0dc08466-5 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 248f56c4e2bb3fa7bf9a183253578c0455faf913 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sun, 20 Nov 2022 17:43:54 +0100 Subject: [PATCH 51/72] chore(updatecli) adapt manifest for v0.38.0 Signed-off-by: Damien Duportal --- .github/workflows/updatecli.yaml | 2 +- .../updatecli.d/jenkins-agent-parent.yaml | 55 ++++--------------- 2 files changed, 12 insertions(+), 45 deletions(-) diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml index cb2063ae..782f56a6 100644 --- a/.github/workflows/updatecli.yaml +++ b/.github/workflows/updatecli.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v3 - name: Install Updatecli in the runner - uses: updatecli/updatecli-action@v2.14.0 + uses: updatecli/updatecli-action@v2.15.0 - name: Run Updatecli in Dry Run mode run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml diff --git a/updatecli/updatecli.d/jenkins-agent-parent.yaml b/updatecli/updatecli.d/jenkins-agent-parent.yaml index a51589cd..5072dbb6 100644 --- a/updatecli/updatecli.d/jenkins-agent-parent.yaml +++ b/updatecli/updatecli.d/jenkins-agent-parent.yaml @@ -42,60 +42,27 @@ conditions: architecture: amd64 image: jenkins/agent tag: '{{source "lastVersion" }}-alpine-jdk17' - checkJdk11DebianAmd64DockerImage: + checkJdk11DebianDockerImages: kind: dockerimage name: Check if the container image "jenkins/agent:-jdk11" for linux/amd64 is available disablesourceinput: true spec: - architecture: amd64 - image: jenkins/agent - tag: '{{source "lastVersion" }}-jdk11' - checkJdk11DebianArm64DockerImage: - kind: dockerimage - name: Check if the container image "jenkins/agent:-jdk11" for linux/arm64 is available - disablesourceinput: true - spec: - architecture: arm64 - image: jenkins/agent - tag: '{{source "lastVersion" }}-jdk11' - checkJdk11DebianArmv7DockerImage: - kind: dockerimage - name: Check if the container image "jenkins/agent:-jdk11" for linux/arm/v7 is available - disablesourceinput: true - spec: - architecture: arm/v7 + architectures: + - amd64 + - arm64 + - arm/v7 + - s390x image: jenkins/agent tag: '{{source "lastVersion" }}-jdk11' - checkJdk11DebianS390xDockerImage: - kind: dockerimage - name: Check if the container image "jenkins/agent:-jdk11" for linux/s390x is available - disablesourceinput: true - spec: - architecture: s390x - image: jenkins/agent - tag: '{{source "lastVersion" }}-jdk11' - checkJdk17DebianAmd64DockerImage: + checkJdk17DebianDockerImages: kind: dockerimage name: Check if the container image "jenkins/agent:-jdk17" for linux/amd64 is available disablesourceinput: true spec: - architecture: amd64 - image: jenkins/agent - tag: '{{source "lastVersion" }}-jdk17' - checkJdk17DebianArm64DockerImage: - kind: dockerimage - name: Check if the container image "jenkins/agent:-jdk17" for linux/arm64 is available - disablesourceinput: true - spec: - architecture: arm64 - image: jenkins/agent - tag: '{{source "lastVersion" }}-jdk17' - checkJdk17DebianArmv7DockerImage: - kind: dockerimage - name: Check if the container image "jenkins/agent:-jdk17" for linux/arm/v7 is available - disablesourceinput: true - spec: - architecture: arm/v7 + architectures: + - amd64 + - arm64 + - arm/v7 image: jenkins/agent tag: '{{source "lastVersion" }}-jdk17' checkJdk11WindowsNanoserver1809DockerImage: From 00b011261c5994f7928412371e361a088de270b4 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:53 +0000 Subject: [PATCH 52/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index 04d971f4..e148bd4c 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,7 +1,7 @@ -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk17 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 48cd7c5aa42c55ea291677c81c201df56783ebfa Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:54 +0000 Subject: [PATCH 53/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index 65b8505c..d5cfd66a 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-alpine-jdk17 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 8977752e435dda2c61306aef43960c9adbf5ac0d Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:55 +0000 Subject: [PATCH 54/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- make.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.ps1 b/make.ps1 index 89cb4901..4bba94c4 100644 --- a/make.ps1 +++ b/make.ps1 @@ -5,7 +5,7 @@ Param( [String] $AdditionalArgs = '', [String] $Build = '', [String] $VersionTag = '3071.v7e9b_0dc08466-1', - [String] $DockerAgentVersion = '3071.v7e9b_0dc08466-5', + [String] $DockerAgentVersion = '3077.vd69cf116da_6f-1', [switch] $PushVersions = $false ) From ee0dc065ca1166e30d9aa3c15fa027d9b5cd18a5 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:56 +0000 Subject: [PATCH 55/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 43349f6f..7c479336 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk11-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From 606264749b44eea452a308c10096321fe024b59a Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:57 +0000 Subject: [PATCH 56/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 7439907e..bca12390 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -25,7 +25,7 @@ variable "IMAGE_TAG" { #### This is for the "parent" image version to use (jenkins/agent:-) variable "PARENT_IMAGE_VERSION" { - default = "3071.v7e9b_0dc08466-5" + default = "3077.vd69cf116da_6f-1" } variable "REGISTRY" { From 55973145f4fbdd4b45a7e7ea312b35f40325e5a2 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:57 +0000 Subject: [PATCH 57/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index f2141290..e03e4620 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk17-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From c3bb432228e42bcc2913f0512b82a933083d624c Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:58 +0000 Subject: [PATCH 58/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index e02f3118..1674544b 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk11-nanoserver-1809 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From 080153c97b72588bd6684403e8d8b282edb63560 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:35:59 +0000 Subject: [PATCH 59/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/debian/Dockerfile b/11/debian/Dockerfile index e1d88d37..47b1e451 100644 --- a/11/debian/Dockerfile +++ b/11/debian/Dockerfile @@ -20,10 +20,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk11 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From d04e5f469c1739b1a25381fa1af74e8c95b94d86 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:36:00 +0000 Subject: [PATCH 60/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index d1a217d8..32bfddcb 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-alpine-jdk11 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 2ef5516cbd9afe49933efcb09a71ceffecb1bcc2 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:36:00 +0000 Subject: [PATCH 61/72] chore: changed lines [1 4] of file "/tmp/updatecli/github/jenkinsci/doc... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ker-inbound-agent/17/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index b991da24..f5827bcb 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 FROM jenkins/agent:${version}-jdk17-nanoserver-1809 -ARG version=3071.v7e9b_0dc08466-5 +ARG version=3077.vd69cf116da_6f-1 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From d0d4aaaf9ec3cf81b65618b82d54367e2df4157e Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:44 +0000 Subject: [PATCH 62/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/debian/Dockerfile b/11/debian/Dockerfile index 47b1e451..7247634b 100644 --- a/11/debian/Dockerfile +++ b/11/debian/Dockerfile @@ -20,10 +20,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk11 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 041099efe8098cee35cbce00df8b6b5c328d0c45 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:45 +0000 Subject: [PATCH 63/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index d5cfd66a..43d4ce1b 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-alpine-jdk17 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From 579ba2c7cb23a2b2d40cf5c643cdb74ed9d06db1 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:46 +0000 Subject: [PATCH 64/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- make.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.ps1 b/make.ps1 index 4bba94c4..dd9435b6 100644 --- a/make.ps1 +++ b/make.ps1 @@ -5,7 +5,7 @@ Param( [String] $AdditionalArgs = '', [String] $Build = '', [String] $VersionTag = '3071.v7e9b_0dc08466-1', - [String] $DockerAgentVersion = '3077.vd69cf116da_6f-1', + [String] $DockerAgentVersion = '3077.vd69cf116da_6f-2', [switch] $PushVersions = $false ) From 4faaaa2704a0f683a67a207d65d6bb6c117a802e Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:47 +0000 Subject: [PATCH 65/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- docker-bake.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index bca12390..2de487d0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -25,7 +25,7 @@ variable "IMAGE_TAG" { #### This is for the "parent" image version to use (jenkins/agent:-) variable "PARENT_IMAGE_VERSION" { - default = "3077.vd69cf116da_6f-1" + default = "3077.vd69cf116da_6f-2" } variable "REGISTRY" { From d817009b46645f4b2fb3b2c646bfcc23e610c29e Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:48 +0000 Subject: [PATCH 66/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile index 7c479336..c6543840 100644 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ b/11/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk11-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From bbb0c02426447af4bb74b712e23a73b9c922955f Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:49 +0000 Subject: [PATCH 67/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/alpine/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile index 32bfddcb..e12cad04 100644 --- a/11/alpine/Dockerfile +++ b/11/alpine/Dockerfile @@ -21,10 +21,10 @@ # THE SOFTWARE. #TODO(oleg_nenashev): Does it also need an update? -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-alpine-jdk11 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From b29e9d03bfa1a93466b09abd35f2ab16a4cb3105 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:50 +0000 Subject: [PATCH 68/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 11/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile index 1674544b..19824ac3 100644 --- a/11/windows/nanoserver-1809/Dockerfile +++ b/11/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk11-nanoserver-1809 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From 005a073929d7edcd2bbf56861459c1a98bc5d6c5 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:51 +0000 Subject: [PATCH 69/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index e03e4620..11b56fa9 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk17-windowsservercore-ltsc2019 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" From 2ff5bc466446f9e88ca5d733379be6853246ad70 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:52 +0000 Subject: [PATCH 70/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/nanoserver-1809/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index f5827bcb..d8544513 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -21,10 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk17-nanoserver-1809 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols on Windows" Vendor="Jenkins Project" Version="$version" ARG user=jenkins From 49cc081a9907af273a52e78bc5f432fee763a440 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 17:18:53 +0000 Subject: [PATCH 71/72] chore: changed lines [23 26] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-inbound-agent/11/debian/Dockerfile" Made with ❤️️ by updatecli --- 17/debian/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile index e148bd4c..b07d0d53 100644 --- a/17/debian/Dockerfile +++ b/17/debian/Dockerfile @@ -1,7 +1,7 @@ -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 FROM jenkins/agent:${version}-jdk17 -ARG version=3077.vd69cf116da_6f-1 +ARG version=3077.vd69cf116da_6f-2 LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" ARG user=jenkins From dd9d59d62b46d5cb26c6d39f652d6d995fb9bf0c Mon Sep 17 00:00:00 2001 From: Alex Earl Date: Thu, 24 Nov 2022 10:28:57 -0700 Subject: [PATCH 72/72] Fixup command line processing and add test --- jenkins-agent.ps1 | 16 +++++++++++----- tests/inboundAgent.Tests.ps1 | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/jenkins-agent.ps1 b/jenkins-agent.ps1 index 7e0ae27d..2f354c2e 100644 --- a/jenkins-agent.ps1 +++ b/jenkins-agent.ps1 @@ -22,7 +22,7 @@ [CmdletBinding()] Param( - $Cmd = '', # this is only used when docker run has one arg positional arg + $Cmd = '', # this must be specified explicitly $Url = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_URL)) { throw ("Url is required") } else { '' } ), [Parameter(Position=0)]$Secret = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_SECRET)) { throw ("Secret is required") } else { '' } ), [Parameter(Position=1)]$Name = $( if([System.String]::IsNullOrWhiteSpace($Cmd) -and [System.String]::IsNullOrWhiteSpace($env:JENKINS_AGENT_NAME)) { throw ("Name is required") } else { '' } ), @@ -34,12 +34,13 @@ Param( $Protocols = '', $JenkinsJavaBin = '', $JavaHome = $env:JAVA_HOME, - $JavaOpts = '' + $JenkinsJavaOpts = '' ) # Usage jenkins-agent.ps1 [options] -Url http://jenkins -Secret [SECRET] -Name [AGENT_NAME] # Optional environment variables : # * JENKINS_JAVA_BIN : Java executable to use instead of the default in PATH or obtained from JAVA_HOME +# * JENKINS_JAVA_OPTS : Java Options to use for the remoting process, otherwise obtained from JAVA_OPTS # * JENKINS_TUNNEL : HOST:PORT for a tunnel to route TCP traffic to jenkins host, when jenkins can't be directly accessed over network # * JENKINS_URL : alternate jenkins URL # * JENKINS_SECRET : agent secret, if not set as an argument @@ -59,6 +60,7 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { # this maps the variable name from the CmdletBinding to environment variables $ParamMap = @{ 'JenkinsJavaBin' = 'JENKINS_JAVA_BIN'; + 'JenkinsJavaOpts' = 'JENKINS_JAVA_OPTS'; 'Tunnel' = 'JENKINS_TUNNEL'; 'Url' = 'JENKINS_URL'; 'Secret' = 'JENKINS_SECRET'; @@ -68,7 +70,6 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { 'DirectConnection' = 'JENKINS_DIRECT_CONNECTION'; 'InstanceIdentity' = 'JENKINS_INSTANCE_IDENTITY'; 'Protocols' = 'JENKINS_PROTOCOLS'; - 'JavaOpts' = 'JAVA_OPTS'; } # this does some trickery to update the variable from the CmdletBinding @@ -94,8 +95,13 @@ if(![System.String]::IsNullOrWhiteSpace($Cmd)) { $AgentArguments = @() - if(![System.String]::IsNullOrWhiteSpace($JavaOpts)) { - $AgentArguments += @($JavaOpts.split(" ")) + if(![System.String]::IsNullOrWhiteSpace($JenkinsJavaOpts)) { + # this magic will basically process the $JenkinsJavaOpts like a command line + # and split into an array, the command line processing follows the PowerShell + # commnd line processing, which means for things like -Dsomething.something=something, + # you need to quote the string like this: "-Dsomething.something=something" or else it + # will get parsed incorrectly. + $AgentArguments += Invoke-Expression "echo $JenkinsJavaOpts" } $AgentArguments += @("-cp", "C:/ProgramData/Jenkins/agent.jar", "hudson.remoting.jnlp.Main", "-headless") diff --git a/tests/inboundAgent.Tests.ps1 b/tests/inboundAgent.Tests.ps1 index 3bd65439..01af53de 100644 --- a/tests/inboundAgent.Tests.ps1 +++ b/tests/inboundAgent.Tests.ps1 @@ -43,7 +43,6 @@ Describe "[$global:JDK $global:FLAVOR] build image" { It 'builds image' { $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "build --build-arg VERSION=$global:VERSION -t $global:AGENT_IMAGE $global:FOLDER" - # This failure was added on purpose to verify that the build will fail if a test fails $exitCode | Should -Be 0 } @@ -172,3 +171,37 @@ Describe "[$global:JDK $global:FLAVOR] build args" { Pop-Location -StackName 'agent' } } + + +Describe "[$global:JDK $global:FLAVOR] passing JVM options (slow test)" { + It "shows the java version with --show-version" { + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "network create --driver nat jnlp-network" + # Launch the netcat utility, listening at port 5000 for 30 sec + # bats will capture the output from netcat and compare the first line + # of the header of the first HTTP request with the expected one + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --name nmap --network=jnlp-network nmap:latest ncat.exe -w 30 -l 5000" + $exitCode | Should -Be 0 + Is-ContainerRunning "nmap" | Should -BeTrue + + # get the ip address of the nmap container + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "inspect -f `"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}`" nmap" + $exitCode | Should -Be 0 + $nmap_ip = $stdout.Trim() + + # run Jenkins agent which tries to connect to the nmap container at port 5000 + $secret = "aaa" + $name = "bbb" + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "run -dit --network=jnlp-network --name $global:AGENT_CONTAINER $global:AGENT_IMAGE -Url http://${nmap_ip}:5000 -JenkinsJavaOpts `"--show-version`" $secret $name" + $exitCode | Should -Be 0 + Is-ContainerRunning $global:AGENT_CONTAINER | Should -BeTrue + $exitCode, $stdout, $stderr = Run-Program 'docker.exe' "logs $global:AGENT_CONTAINER" + $exitCode | Should -Be 0 + $stdout | Should -Match "OpenJDK Runtime Environment Temurin-${global:JDK}" + } + + AfterAll { + Cleanup($global:AGENT_CONTAINER) + Cleanup("nmap") + CleanupNetwork("jnlp-network") + } +} \ No newline at end of file