From cce55648cca21e0ce797a4ad677d90008dd85a56 Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Thu, 11 May 2023 11:27:48 -0500 Subject: [PATCH] Reintroduce Docker containers for release. Releasing requires additional tools inside the container that does the releasing process, whether to maven central or artifactory. Resolves #1353. --- Jenkinsfile | 17 ++++++++++++++++- ci/Dockerfile | 6 ++++++ ci/pipeline.properties | 5 +++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ci/Dockerfile diff --git a/Jenkinsfile b/Jenkinsfile index 7e7ffe055..467c11aa4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,6 +17,21 @@ pipeline { } stages { + stage('Publish Eclipse Temurin (main) + gpg docker image') { + when { + changeset "ci/Dockerfile" + } + agent any + + steps { + script { + def image = docker.build("${p['docker.java.build.image']}", "ci/") + docker.withRegistry('', "${p['dockerhub.credentials']}") { + image.push() + } + } + } + } stage("Test: baseline (main)") { agent any options { timeout(time: 30, unit: 'MINUTES')} @@ -85,7 +100,7 @@ pipeline { steps { script { - docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { + docker.image("${p['docker.java.build.image-proxy']}").inside(p['docker.java.inside.basic']) { PROJECT_VERSION = sh( script: "ci/version.sh", returnStdout: true diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 000000000..0a718839c --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,6 @@ +FROM eclipse-temurin:17.0.6_10-jdk-focal + +RUN apt-get update && apt-get install -y gpg + +RUN apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/ci/pipeline.properties b/ci/pipeline.properties index f641314dd..ff3d66d35 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -6,8 +6,13 @@ java.next.tag=20-jdk-jammy docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag} docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag} +# Docker container images - for release +docker.java.build.image=springci/spring-ws-eclipse-temurin-with-gpg:${java.main.tag} +docker.java.build.image-proxy=harbor-repo.vmware.com/dockerhub-proxy-cache/${docker.java.build.image} + # Docker environment settings docker.java.inside.basic=-v $HOME:/tmp/jenkins-home # Credentials artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c +dockerhub.credentials=hub.docker.com-springbuildmaster