From aac6a65ef95e01d8cfeae72cf2adaa01a9aaab84 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 07:28:50 -0500 Subject: [PATCH 01/13] feat: upgrade jenkinsfile-runner to Java 17 and Jenkins version 2.462.3 --- Jenkinsfile | 2 +- app/pom.xml | 1 + packaging-parent-pom/pom.xml | 4 ++-- packaging-slim-parent-pom/pom.xml | 2 +- packaging/docker/README.adoc | 2 +- packaging/docker/build-mvncache/Dockerfile | 2 +- .../Dockerfile | 19 ++++++++-------- .../Dockerfile | 22 +++++++++---------- .../docker/unix/jenkinsfile-runner-launcher | 3 +++ payload-dependencies/pom.xml | 6 +++++ payload/pom.xml | 15 +++++++++++-- pom.xml | 22 +++++++++---------- tests/pom.xml | 2 +- vanilla-package/pom.xml | 16 +++++++++----- .../jenkinsfile/runner/vanilla/SmokeTest.java | 4 ++-- 15 files changed, 73 insertions(+), 49 deletions(-) rename packaging/docker/unix/{eclipse-temurin-11-jre-alpine => eclipse-temurin-17-jre-alpine}/Dockerfile (78%) rename packaging/docker/unix/{eclipse-temurin-11-jre => eclipse-temurin-17-jre}/Dockerfile (77%) diff --git a/Jenkinsfile b/Jenkinsfile index 4a239014..6b84549e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ for (int i = 0; i < platforms.size(); ++i) { stage('Build') { timeout(60) { - infra.runMaven(['clean', 'install', '-Dset.changelist', '-Dmaven.test.failure.ignore=true', '-Denvironment=test', '-Ppackage-app,package-vanilla,jacoco,run-its'], '11') + infra.runMaven(['clean', 'install', '-Dset.changelist', '-Dmaven.test.failure.ignore=true', '-Denvironment=test', '-Ppackage-app,package-vanilla,jacoco,run-its', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.lang=ALL-UNNAMED', '--add-opens=java.base/java.lang.invoke=ALL-UNNAMED'], '17') } } diff --git a/app/pom.xml b/app/pom.xml index f5764f28..9688b4bf 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -23,6 +23,7 @@ assemble + --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED jenkinsfile-runner diff --git a/packaging-parent-pom/pom.xml b/packaging-parent-pom/pom.xml index 86f3bbb4..9b69a96b 100644 --- a/packaging-parent-pom/pom.xml +++ b/packaging-parent-pom/pom.xml @@ -176,7 +176,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.3.0 + 3.7.1 ${jfr.packaging.skip.assembly} - 8 + 11 ${jenkins.version} ${project.build.directory}/plugins diff --git a/packaging-slim-parent-pom/pom.xml b/packaging-slim-parent-pom/pom.xml index 5262982e..7c3ab4a5 100644 --- a/packaging-slim-parent-pom/pom.xml +++ b/packaging-slim-parent-pom/pom.xml @@ -64,7 +64,7 @@ - 8 + 11 ${jenkins.version} ${project.build.directory}/plugins diff --git a/packaging/docker/README.adoc b/packaging/docker/README.adoc index a6648e8f..c3a52179 100644 --- a/packaging/docker/README.adoc +++ b/packaging/docker/README.adoc @@ -27,7 +27,7 @@ Examples: `eclipse-temurin-11-jre`, `eclipse-temurin-11-jre-alpine` * `JVM_VENDOR` - source of the JVM in lowercase, e.g. Eclipse Temurin. * `JAVA_VERSION` - version of the JVM. - Right now `11` are used, fine-grain versions might be added in the future. + Right now `17` are used, fine-grain versions might be added in the future. * `JVM_CLASSIFIER` - Additional information about the JVM used in the image. It might refer to `jdk`/`jre` or a JVM type (e.g. `jre-alpine`, `openj9`). Multiple classifiers might be used. diff --git a/packaging/docker/build-mvncache/Dockerfile b/packaging/docker/build-mvncache/Dockerfile index ed563e8d..1aa188f1 100644 --- a/packaging/docker/build-mvncache/Dockerfile +++ b/packaging/docker/build-mvncache/Dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.8.6-eclipse-temurin-11 +FROM maven:3.9.9-eclipse-temurin-17-focal WORKDIR /src ENV MAVEN_OPTS=-Dmaven.repo.local=/mavenrepo ADD . /src diff --git a/packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile similarity index 78% rename from packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile rename to packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile index eaa24687..e445ea5b 100644 --- a/packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile @@ -1,6 +1,6 @@ FROM jenkins/jenkinsfile-runner:build-mvncache as jenkinsfilerunner-mvncache -FROM maven:3.8.6-eclipse-temurin-11 as jenkinsfilerunner-build +FROM maven:3.9.9-eclipse-temurin-17-focal as jenkinsfilerunner-build RUN apt-get update && apt-get install -y unzip ENV MAVEN_OPTS=-Dmaven.repo.local=/mavenrepo COPY --from=jenkinsfilerunner-mvncache /mavenrepo /mavenrepo @@ -14,22 +14,21 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors +ADD .git /jenkinsfile-runner/.git +RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ + -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" # Prepare the Jenkins core RUN mkdir /app && unzip /jenkinsfile-runner/vanilla-package/target/war/jenkins.war -d /app/jenkins && \ - rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar \ -# Delete HPI files and use the archive directories instead -RUN echo "Optimizing plugins..." && \ - cd /jenkinsfile-runner/vanilla-package/target/plugins && \ - rm -rf *.hpi && \ - for f in * ; do echo "Exploding $f..." && mv "$f" "$f.hpi" ; done; + rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help \ + /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar -FROM eclipse-temurin:11.0.18_10-jre-alpine +FROM eclipse-temurin:17-jre-alpine ENV JENKINS_UC https://updates.jenkins.io ENV CASC_JENKINS_CONFIG /usr/share/jenkins/ref/casc -ENV JENKINS_PM_VERSION 2.5.0 +ENV JENKINS_PM_VERSION 2.13.2 ENV JENKINS_PM_URL https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${JENKINS_PM_VERSION}/jenkins-plugin-manager-${JENKINS_PM_VERSION}.jar +ENV JDK_17 true USER root RUN apk add --update --no-cache wget git \ diff --git a/packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile similarity index 77% rename from packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile rename to packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile index cec7c423..d6d27709 100644 --- a/packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile @@ -1,6 +1,6 @@ FROM jenkins/jenkinsfile-runner:build-mvncache as jenkinsfilerunner-mvncache -FROM maven:3.8.6-eclipse-temurin-11 as jenkinsfilerunner-build +FROM maven:3.9.9-eclipse-temurin-17-focal as jenkinsfilerunner-build RUN apt-get update && apt-get install -y unzip ENV MAVEN_OPTS=-Dmaven.repo.local=/mavenrepo COPY --from=jenkinsfilerunner-mvncache /mavenrepo /mavenrepo @@ -14,24 +14,22 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors +ADD .git /jenkinsfile-runner/.git +RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ + -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" # Prepare the Jenkins core RUN mkdir /app && unzip /jenkinsfile-runner/vanilla-package/target/war/jenkins.war -d /app/jenkins && \ - rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar \ -# Delete HPI files and use the archive directories instead -RUN echo "Optimizing plugins..." && \ - cd /jenkinsfile-runner/vanilla-package/target/plugins && \ - rm -rf *.hpi && \ - for f in * ; do echo "Exploding $f..." && mv "$f" "$f.hpi" ; done; - -FROM eclipse-temurin:11.0.18_10-jre + rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help \ + /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar + +FROM eclipse-temurin:17-jre RUN apt-get update && apt-get install wget && rm -rf /var/lib/apt/lists/* -ENV JDK_11 true +ENV JDK_17 true ENV JENKINS_UC https://updates.jenkins.io ENV CASC_JENKINS_CONFIG /usr/share/jenkins/ref/casc -ENV JENKINS_PM_VERSION 2.5.0 +ENV JENKINS_PM_VERSION 2.13.2 ENV JENKINS_PM_URL https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${JENKINS_PM_VERSION}/jenkins-plugin-manager-${JENKINS_PM_VERSION}.jar USER root diff --git a/packaging/docker/unix/jenkinsfile-runner-launcher b/packaging/docker/unix/jenkinsfile-runner-launcher index d6f33bca..2f25762d 100755 --- a/packaging/docker/unix/jenkinsfile-runner-launcher +++ b/packaging/docker/unix/jenkinsfile-runner-launcher @@ -6,6 +6,9 @@ fi if [ -n "$JDK_11" ] ; then export JAVA_OPTS="--illegal-access=permit $JAVA_OPTS" fi +if [ -n "$JDK_17" ] ; then + export JAVA_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED $JAVA_OPTS" +fi # check if the user has provided a path to the file if [ -z "${JENKINSFILE_PATH}" ] ; then diff --git a/payload-dependencies/pom.xml b/payload-dependencies/pom.xml index 56a96eea..dfd7cd06 100644 --- a/payload-dependencies/pom.xml +++ b/payload-dependencies/pom.xml @@ -70,6 +70,12 @@ org.jenkins-ci.plugins scm-api + + + io.jenkins.plugins + asm-api + + io.jenkins diff --git a/payload/pom.xml b/payload/pom.xml index c649398c..6b5d50df 100644 --- a/payload/pom.xml +++ b/payload/pom.xml @@ -34,6 +34,11 @@ org.jenkins-ci symbol-annotation + + org.projectlombok + lombok + 1.18.34 + io.jenkins.plugins pipeline-as-yaml @@ -53,12 +58,18 @@ com.google.code.gson gson - 2.10.1 + 2.11.0 + + + com.google.errorprone + error_prone_annotations + + org.jenkins-ci.plugins templating-engine - 2.3 + 2.5.3 true diff --git a/pom.xml b/pom.xml index 51c9c521..062ca80d 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci jenkins - 1.107 + 1.126 @@ -65,12 +65,12 @@ THE SOFTWARE. -SNAPSHOT jenkinsci/jenkinsfile-runner UTF-8 - 11 - 2.375.4 - bom-2.375.x - 2025.v816d28f1e04f - 10.0.12 - 2140.ve736dc2b_b_d2c + 17 + 2.462.3 + bom-2.462.x + 3387.v0f2773fa_3200 + 10.0.24 + 2287.v4f0199c6eda_8 false @@ -101,14 +101,14 @@ THE SOFTWARE. org.apache.commons commons-lang3 - 3.12.0 + 3.17.0 org.jenkins-ci.plugins pipeline-utility-steps - 2.16.0 + 2.16.2 @@ -135,7 +135,7 @@ THE SOFTWARE. maven-compiler-plugin - 11 + 17 @@ -207,7 +207,7 @@ THE SOFTWARE. org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.12 diff --git a/tests/pom.xml b/tests/pom.xml index 493ee16e..7bb78085 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -23,7 +23,7 @@ org.codehaus.mojo exec-maven-plugin - 3.0.0 + 3.5.0 test diff --git a/vanilla-package/pom.xml b/vanilla-package/pom.xml index 2c331f87..0357d007 100644 --- a/vanilla-package/pom.xml +++ b/vanilla-package/pom.xml @@ -54,6 +54,12 @@ org.jenkins-ci.plugins git + + + io.jenkins.plugins + asm-api + + @@ -73,12 +79,12 @@ org.jenkins-ci.plugins job-dsl - 1.81 + 1.88 org.jenkins-ci.plugins templating-engine - 2.3 + 2.5.3 com.google.errorprone @@ -95,7 +101,7 @@ org.apache.commons commons-text - 1.10.0 + 1.12.0 @@ -164,7 +170,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.6.0 add-integration-test-sources @@ -198,7 +204,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 2.22.2 + 3.5.2 integration-tests diff --git a/vanilla-package/src/test/java/io/jenkins/jenkinsfile/runner/vanilla/SmokeTest.java b/vanilla-package/src/test/java/io/jenkins/jenkinsfile/runner/vanilla/SmokeTest.java index a5ee1e4b..d8f548d0 100644 --- a/vanilla-package/src/test/java/io/jenkins/jenkinsfile/runner/vanilla/SmokeTest.java +++ b/vanilla-package/src/test/java/io/jenkins/jenkinsfile/runner/vanilla/SmokeTest.java @@ -109,7 +109,7 @@ public void shouldFailWithWrongJenkinsfile() throws Throwable { int result = new JFRTestUtil().run(jenkinsfile); assertThat("JFR should fail when there is no Jenkinsfile", result, not(equalTo(0))); - assertThat(systemOut.getLog(), containsString("FileNotFoundException")); + assertThat(systemOut.getLog(), containsString("NoSuchFileException")); } // TODO: uncomment once JFR can do something about timeouts internally @@ -220,7 +220,7 @@ public void shouldFailWithABrokenConfig() throws Throwable { System.setProperty(ConfigurationAsCode.CASC_JENKINS_CONFIG_PROPERTY, jcasc.getAbsolutePath()); int result = new JFRTestUtil().runAsCLI(jenkinsfile); assertThat("Jenkinsfile Runner execution should have failed", result, not(equalTo(0))); - assertThat(systemErr.getLog(), containsString("No configurator for the following root elements globalNodeProperties")); + assertThat(systemErr.getLog(), containsString("No configurator for the following root elements:globalNodeProperties")); } finally { System.clearProperty(ConfigurationAsCode.CASC_JENKINS_CONFIG_PROPERTY); } From 9bd88500baa5b4f3dc03bda52f82929bc4a5a97f Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 07:43:02 -0500 Subject: [PATCH 02/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 22 +++++++++---------- .../workflows/publish-release-artifact.yml | 20 ++++++++--------- Jenkinsfile | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index e2662b4c..1794b703 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -14,14 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'temurin' - name: Build with Maven working-directory: . - run: mvn -B package + run: mvn -B package -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" build-docker: runs-on: ubuntu-latest @@ -67,16 +67,16 @@ jobs: fail-fast: false matrix: include: - - alias: jre-11 - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile - tag-prefix: eclipse-temurin-11-jre- + - alias: jre-17 + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile + tag-prefix: eclipse-temurin-17-jre- tag-latest: true - extra-tags: ", ghcr.io/${{ github.repository }}:jre-11" - - alias: jre-11-alpine - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile - tag-prefix: eclipse-temurin-11-jre-alpine- + extra-tags: ", ghcr.io/${{ github.repository }}:jre-17" + - alias: jre-17-alpine + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile + tag-prefix: eclipse-temurin-17-jre-alpine- tag-latest: false - extra-tags: ", ghcr.io/${{ github.repository }}:alpine, ghcr.io/${{ github.repository }}:jre-11-alpine" + extra-tags: ", ghcr.io/${{ github.repository }}:alpine, ghcr.io/${{ github.repository }}:jre-17-alpine" needs: - build-maven - build-docker diff --git a/.github/workflows/publish-release-artifact.yml b/.github/workflows/publish-release-artifact.yml index dfb41b75..002bf5a4 100644 --- a/.github/workflows/publish-release-artifact.yml +++ b/.github/workflows/publish-release-artifact.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: Set version id: set-version @@ -55,14 +55,14 @@ jobs: fail-fast: false matrix: include: - - alias: jre-11 - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile - tag-prefix: eclipse-temurin-11-jre- - extra-tags--pattern: ", ghcr.io/${{ github.repository }}:jre-11-$RELEASE_VERSION" - - alias: jre-11-alpine - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile - tag-prefix: eclipse-temurin-11-jre-alpine- - extra-tags-pattern: ", ghcr.io/${{ github.repository }}:alpine-$RELEASE_VERSION, ghcr.io/${{ github.repository }}:jre-11-alpine-$RELEASE_VERSION" + - alias: jre-17 + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile + tag-prefix: eclipse-temurin-17-jre- + extra-tags--pattern: ", ghcr.io/${{ github.repository }}:jre-17-$RELEASE_VERSION" + - alias: jre-17-alpine + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile + tag-prefix: eclipse-temurin-17-jre-alpine- + extra-tags-pattern: ", ghcr.io/${{ github.repository }}:alpine-$RELEASE_VERSION, ghcr.io/${{ github.repository }}:jre-17-alpine-$RELEASE_VERSION" permissions: contents: read packages: write diff --git a/Jenkinsfile b/Jenkinsfile index 6b84549e..35a13f87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ Map branches = [:] for (int i = 0; i < platforms.size(); ++i) { String label = platforms[i] branches[label] = { - node(label + " && docker") { + node("docker && linux-amd64") { timestamps { ws("platform_${label}_${branchName}_${buildNumber}") { stage('Checkout') { From 6a78e9ef39b2cb201fbd1c039bcbfc69777721d1 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 07:46:52 -0500 Subject: [PATCH 03/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 8 ++++---- CONTRIBUTING.adoc | 4 ++-- packaging-slim-parent-pom/README.adoc | 2 +- packaging/docker/README.adoc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 1794b703..df465ab4 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -32,11 +32,11 @@ jobs: fail-fast: false matrix: include: - - alias: jre-11 - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile + - alias: jre-17 + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile tags: test - - alias: jre-11-alpine - dockerfile: packaging/docker/unix/eclipse-temurin-11-jre-alpine/Dockerfile + - alias: jre-17-alpine + dockerfile: packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile tags: test-alpine name: "Build Docker image: ${{ matrix.alias }}" diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index e1ae0d8b..201dbb36 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -47,11 +47,11 @@ This will generate an assembly artifact through the `appassembler-maven-plugin` This repository includes the base image which can be built simply as... - docker build -t jenkins4eval/jenkinsfile-runner -f packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile . + docker build -t jenkins4eval/jenkinsfile-runner -f packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile . During development you can reuse the local machine build instead of doing a full build from scratch - docker build -t jenkins4eval/jenkinsfile-runner:dev -f packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile-dev-vanilla . + docker build -t jenkins4eval/jenkinsfile-runner:dev -f packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile-dev-vanilla . == Debugging diff --git a/packaging-slim-parent-pom/README.adoc b/packaging-slim-parent-pom/README.adoc index 772484ea..f85f0c48 100644 --- a/packaging-slim-parent-pom/README.adoc +++ b/packaging-slim-parent-pom/README.adoc @@ -17,7 +17,7 @@ The parent POM prepares the following artifacts in `target`: == Usage in Docker -See link:../packaging/docker/unix/eclipse-temurin-11-jre/Dockerfile-dev-slim[Dockerfile-dev-slim] for example. +See link:../packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile-dev-slim[Dockerfile-dev-slim] for example. This example also uses additional optimization tricks. == Status diff --git a/packaging/docker/README.adoc b/packaging/docker/README.adoc index c3a52179..b754f2e6 100644 --- a/packaging/docker/README.adoc +++ b/packaging/docker/README.adoc @@ -23,7 +23,7 @@ The following format is used: ${JVM_VENDOR}-${JAVA_VERSION}[-${JVM_CLASSIFIER1}][-${JVM_CLASSIFIER2}]...[-${OS}] ---- -Examples: `eclipse-temurin-11-jre`, `eclipse-temurin-11-jre-alpine` +Examples: `eclipse-temurin-17-jre`, `eclipse-temurin-17-jre-alpine` * `JVM_VENDOR` - source of the JVM in lowercase, e.g. Eclipse Temurin. * `JAVA_VERSION` - version of the JVM. From e06186284627e0e27b54b4e4b3d44ecd48126e4e Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 07:48:58 -0500 Subject: [PATCH 04/13] fix: github actions and Jenkinsfile build --- Jenkinsfile | 2 +- packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile | 1 - packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 35a13f87..f1a53120 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ Map branches = [:] for (int i = 0; i < platforms.size(); ++i) { String label = platforms[i] branches[label] = { - node("docker && linux-amd64") { + node("maven-17") { timestamps { ws("platform_${label}_${branchName}_${buildNumber}") { stage('Checkout') { diff --git a/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile index e445ea5b..5a299eaf 100644 --- a/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile @@ -14,7 +14,6 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -ADD .git /jenkinsfile-runner/.git RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" diff --git a/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile index d6d27709..c88443d6 100644 --- a/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile @@ -14,7 +14,6 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -ADD .git /jenkinsfile-runner/.git RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" # Prepare the Jenkins core From c65c85b20aadcc6a776582f8b4717715683bb972 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:10:27 -0500 Subject: [PATCH 05/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 4 ++++ .../docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile | 7 +++---- packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile | 7 +++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index df465ab4..31af5a91 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -13,6 +13,10 @@ jobs: build-maven: runs-on: ubuntu-latest steps: + - name: Install dependencies + run: | + apt-get update + apt-get install -y git - uses: actions/checkout@v2 - name: Set up JDK 17 uses: actions/setup-java@v3 diff --git a/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile index 5a299eaf..2eea08f3 100644 --- a/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre-alpine/Dockerfile @@ -14,13 +14,12 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ - -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" +ADD .git /jenkinsfile-runner/.git +RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" # Prepare the Jenkins core RUN mkdir /app && unzip /jenkinsfile-runner/vanilla-package/target/war/jenkins.war -d /app/jenkins && \ - rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help \ - /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar + rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar FROM eclipse-temurin:17-jre-alpine ENV JENKINS_UC https://updates.jenkins.io diff --git a/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile index c88443d6..f7bbfbf4 100644 --- a/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile +++ b/packaging/docker/unix/eclipse-temurin-17-jre/Dockerfile @@ -14,12 +14,11 @@ ADD packaging-parent-resources /jenkinsfile-runner/packaging-parent-resources ADD packaging-parent-pom /jenkinsfile-runner/packaging-parent-pom ADD packaging-slim-parent-pom /jenkinsfile-runner/packaging-slim-parent-pom ADD pom.xml /jenkinsfile-runner/pom.xml -RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors \ - -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" +ADD .git /jenkinsfile-runner/.git +RUN cd /jenkinsfile-runner && mvn clean package --batch-mode -ntp --show-version --errors -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" # Prepare the Jenkins core RUN mkdir /app && unzip /jenkinsfile-runner/vanilla-package/target/war/jenkins.war -d /app/jenkins && \ - rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help \ - /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar + rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help /app/jenkins/WEB-INF/detached-plugins /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar FROM eclipse-temurin:17-jre RUN apt-get update && apt-get install wget && rm -rf /var/lib/apt/lists/* From 343eaabac1f41b42fde7903d1c249e593a290a61 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:10:57 -0500 Subject: [PATCH 06/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 31af5a91..5a86dc9e 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -45,6 +45,10 @@ jobs: name: "Build Docker image: ${{ matrix.alias }}" steps: + - name: Install dependencies + run: | + apt-get update + apt-get install -y git - uses: actions/checkout@v2 - name: Set up Docker Buildx From 9afdbab264f6e33b9d4b4d4ef4e60deaaa7c8936 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:14:39 -0500 Subject: [PATCH 07/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 5a86dc9e..465c27b2 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -15,8 +15,8 @@ jobs: steps: - name: Install dependencies run: | - apt-get update - apt-get install -y git + sudo apt-get update + sudo apt-get install -y git - uses: actions/checkout@v2 - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -47,8 +47,8 @@ jobs: steps: - name: Install dependencies run: | - apt-get update - apt-get install -y git + sudo apt-get update + sudo apt-get install -y git - uses: actions/checkout@v2 - name: Set up Docker Buildx From f1b2c915b77d427af534c9008236a3e85871c582 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:19:02 -0500 Subject: [PATCH 08/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 465c27b2..f4eeac2e 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -12,12 +12,17 @@ env: jobs: build-maven: runs-on: ubuntu-latest + container: + image: ubuntu:22.04 steps: - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y git - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Setup .git folder + run: | + git config --global --add safe.directory "$(pwd)" - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -29,6 +34,8 @@ jobs: build-docker: runs-on: ubuntu-latest + container: + image: ubuntu:22.04 env: IMAGE_NAME: ${{ github.repository }} REGISTRY: ghcr.io @@ -49,7 +56,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y git - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Setup .git folder + run: | + git config --global --add safe.directory "$(pwd)" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1.5.0 @@ -71,6 +81,8 @@ jobs: deploy: if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest + container: + image: ubuntu:22.04 strategy: fail-fast: false matrix: From 3aa34770161dde1e090ab47a5e75f2330c290fa6 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:19:51 -0500 Subject: [PATCH 09/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index f4eeac2e..173c4a9b 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -12,8 +12,6 @@ env: jobs: build-maven: runs-on: ubuntu-latest - container: - image: ubuntu:22.04 steps: - name: Install dependencies run: | @@ -34,8 +32,6 @@ jobs: build-docker: runs-on: ubuntu-latest - container: - image: ubuntu:22.04 env: IMAGE_NAME: ${{ github.repository }} REGISTRY: ghcr.io @@ -81,8 +77,6 @@ jobs: deploy: if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest - container: - image: ubuntu:22.04 strategy: fail-fast: false matrix: From 20a3650377ca55bdb9d338db2e5787de8bf0a827 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:23:36 -0500 Subject: [PATCH 10/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 173c4a9b..54bff401 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup .git folder run: | - git config --global --add safe.directory "$(pwd)" + git fetch --tags origin - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -55,8 +55,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup .git folder run: | - git config --global --add safe.directory "$(pwd)" - + git fetch --tags origin - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1.5.0 From 35cbe639b08737eec147323a515a017c3efee043 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:25:25 -0500 Subject: [PATCH 11/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 54bff401..55f597e9 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -18,6 +18,8 @@ jobs: sudo apt-get update sudo apt-get install -y git - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup .git folder run: | git fetch --tags origin @@ -53,6 +55,8 @@ jobs: sudo apt-get update sudo apt-get install -y git - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup .git folder run: | git fetch --tags origin From ddfa2eb4bfd4e7a16b0726006a1e1d749362e05a Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:29:55 -0500 Subject: [PATCH 12/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 55f597e9..8b3a574f 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -20,9 +20,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup .git folder - run: | - git fetch --tags origin - name: Set up JDK 17 uses: actions/setup-java@v3 with: @@ -57,9 +54,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup .git folder - run: | - git fetch --tags origin - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1.5.0 From 95f373c9a762a5685f757e03e073eea18b88ed85 Mon Sep 17 00:00:00 2001 From: Shawn Thompson Date: Wed, 13 Nov 2024 08:49:54 -0500 Subject: [PATCH 13/13] fix: github actions and Jenkinsfile build --- .github/workflows/docker-cd.yml | 15 ++++++--------- .mvn/extensions.xml | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index 8b3a574f..368eae70 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -13,21 +13,18 @@ jobs: build-maven: runs-on: ubuntu-latest steps: - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y git - - uses: actions/checkout@v4 + - name: Check out + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'temurin' + java-version: 17 + distribution: temurin - name: Build with Maven working-directory: . - run: mvn -B package -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" + run: mvn -B package -Dset.changelist -DargLine="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" build-docker: runs-on: ubuntu-latest diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 43d62816..4e0774d5 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -2,6 +2,6 @@ io.jenkins.tools.incrementals git-changelist-maven-extension - 1.2 + 1.8