From b5b30a1eb7fb2f40819d93a4ae9e17676c92d486 Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Tue, 15 Dec 2020 10:31:09 -0600 Subject: [PATCH] DATAREDIS-1258 - Use Docker hub credentials for all CI jobs. --- Jenkinsfile | 96 +++++++++++++++++++++++++++++------------------------ pom.xml | 5 +++ 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6eb009f5..7365e5618 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,7 +74,7 @@ pipeline { } } - stage("test: baseline") { + stage("test: baseline (jdk8)") { when { anyOf { branch 'master' @@ -82,15 +82,17 @@ pipeline { } } agent { - docker { - image 'springci/spring-data-openjdk8-with-redis-6.0:latest' - label 'data' - args '-v $HOME/.m2:/tmp/jenkins-home/.m2' - } + label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { - sh 'PROFILE=none LONG_TESTS=true ci/test.sh' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('springci/spring-data-openjdk8-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'PROFILE=none LONG_TESTS=true ci/test.sh' + } + } + } } } @@ -104,28 +106,32 @@ pipeline { parallel { stage("test: baseline (jdk11)") { agent { - docker { - image 'springci/spring-data-openjdk11-with-redis-6.0:latest' - label 'data' - args '-v $HOME/.m2:/tmp/jenkins-home/.m2' - } + label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { - sh 'PROFILE=java11 ci/test.sh' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('springci/spring-data-openjdk11-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'PROFILE=java11 ci/test.sh' + } + } + } } } stage("test: baseline (jdk15)") { agent { - docker { - image 'springci/spring-data-openjdk15-with-redis-6.0:latest' - label 'data' - args '-v $HOME/.m2:/tmp/jenkins-home/.m2' - } + label 'data' } options { timeout(time: 30, unit: 'MINUTES') } steps { - sh 'PROFILE=java11 ci/test.sh' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('springci/spring-data-openjdk15-with-redis-6.0:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'PROFILE=java11 ci/test.sh' + } + } + } } } } @@ -139,11 +145,7 @@ pipeline { } } agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME/.m2:/tmp/jenkins-home/.m2' - } + label 'data' } options { timeout(time: 20, unit: 'MINUTES') } @@ -152,14 +154,20 @@ pipeline { } steps { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + - '-Dartifactory.server=https://repo.spring.io ' + - "-Dartifactory.username=${ARTIFACTORY_USR} " + - "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.staging-repository=libs-snapshot-local " + - "-Dartifactory.build-name=spring-data-redis " + - "-Dartifactory.build-number=${BUILD_NUMBER} " + - '-Dmaven.test.skip=true clean deploy -U -B' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + + '-Dartifactory.server=https://repo.spring.io ' + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.staging-repository=libs-snapshot-local " + + "-Dartifactory.build-name=spring-data-redis " + + "-Dartifactory.build-number=${BUILD_NUMBER} " + + '-Dmaven.test.skip=true clean deploy -U -B' + } + } + } } } @@ -168,11 +176,7 @@ pipeline { branch 'master' } agent { - docker { - image 'adoptopenjdk/openjdk8:latest' - label 'data' - args '-v $HOME/.m2:/tmp/jenkins-home/.m2' - } + label 'data' } options { timeout(time: 20, unit: 'MINUTES') } @@ -181,12 +185,18 @@ pipeline { } steps { - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + - '-Dartifactory.server=https://repo.spring.io ' + - "-Dartifactory.username=${ARTIFACTORY_USR} " + - "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.distribution-repository=temp-private-local " + - '-Dmaven.test.skip=true clean deploy -U -B' + script { + docker.withRegistry('', 'hub.docker.com-springbuildmaster') { + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') { + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + + '-Dartifactory.server=https://repo.spring.io ' + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.distribution-repository=temp-private-local " + + '-Dmaven.test.skip=true clean deploy -U -B' + } + } + } } } } diff --git a/pom.xml b/pom.xml index a69a11f3e..ddff5bc04 100644 --- a/pom.xml +++ b/pom.xml @@ -315,5 +315,10 @@ spring-plugins-release https://repo.spring.io/plugins-release + + bintray-plugins + bintray-plugins + https://jcenter.bintray.com +