Skip to content

Commit 94af703

Browse files
committed
Polishing.
Extract docker credentials into properties file. See #1214
1 parent f2a1e52 commit 94af703

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

Jenkinsfile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pipeline {
2323
stage('Publish JDK (main) + Cassandra 3.11') {
2424
when {
2525
anyOf {
26-
changeset "ci/openjdk8-cassandra-3.11/**"
27-
changeset "ci/pipeline.properties"
26+
changeset "ci/openjdk8-cassandra-3.11/**"
27+
changeset "ci/pipeline.properties"
2828
}
2929
}
3030
agent { label 'data' }
@@ -33,7 +33,7 @@ pipeline {
3333
steps {
3434
script {
3535
def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk8-cassandra-3.11/")
36-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
36+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
3737
image.push()
3838
}
3939
}
@@ -42,8 +42,8 @@ pipeline {
4242
stage('Publish JDK (next) + Cassandra 3.11') {
4343
when {
4444
anyOf {
45-
changeset "ci/openjdk11-8-cassandra-3.11/**"
46-
changeset "ci/pipeline.properties"
45+
changeset "ci/openjdk11-8-cassandra-3.11/**"
46+
changeset "ci/pipeline.properties"
4747
}
4848
}
4949
agent { label 'data' }
@@ -52,7 +52,7 @@ pipeline {
5252
steps {
5353
script {
5454
def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.11.tag']}", "--build-arg BASE=${p['docker.java.11.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk11-8-cassandra-3.11/")
55-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
55+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
5656
image.push()
5757
}
5858
}
@@ -70,8 +70,8 @@ pipeline {
7070

7171
steps {
7272
script {
73-
def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.15.tag']}", "--build-arg BASE=${p['docker.java.15.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk17-8-cassandra-3.11/")
74-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
73+
def image = docker.build("springci/spring-data-with-cassandra-3.11:${p['java.15.tag']}", "--build-arg BASE=${p['docker.java.15.image']} --build-arg CASSANDRA=${p['docker.cassandra.3.version']} ci/openjdk15-8-cassandra-3.11/")
74+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
7575
image.push()
7676
}
7777
}
@@ -96,7 +96,7 @@ pipeline {
9696
}
9797
steps {
9898
script {
99-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
99+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
100100
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) {
101101
sh 'mkdir -p /tmp/jenkins-home'
102102
sh 'JAVA_HOME=/opt/java/openjdk /opt/cassandra/bin/cassandra -R &'
@@ -125,7 +125,7 @@ pipeline {
125125
}
126126
steps {
127127
script {
128-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
128+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
129129
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.11.tag']}").inside(p['docker.java.inside.basic']) {
130130
sh 'mkdir -p /tmp/jenkins-home'
131131
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
@@ -145,7 +145,7 @@ pipeline {
145145
}
146146
steps {
147147
script {
148-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
148+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
149149
docker.image("springci/spring-data-with-cassandra-3.11:${p['java.15.tag']}").inside(p['docker.java.inside.basic']) {
150150
sh 'mkdir -p /tmp/jenkins-home'
151151
sh 'JAVA_HOME=/opt/java/openjdk8 /opt/cassandra/bin/cassandra -R &'
@@ -157,6 +157,7 @@ pipeline {
157157
}
158158
}
159159
}
160+
160161
stage('Release to artifactory') {
161162
when {
162163
anyOf {
@@ -175,7 +176,7 @@ pipeline {
175176

176177
steps {
177178
script {
178-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
179+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
179180
docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) {
180181
sh 'mkdir -p /tmp/jenkins-home'
181182
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
@@ -206,7 +207,7 @@ pipeline {
206207

207208
steps {
208209
script {
209-
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
210+
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
210211
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
211212
sh 'mkdir -p /tmp/jenkins-home'
212213
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +

ci/openjdk11-8-cassandra-3.11/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN set -eux; \
1515
useradd -d /home/jenkins-docker -m -u 1001 -U jenkins-docker;
1616

1717
RUN set -eux; \
18-
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz'; \
18+
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz'; \
1919
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
2020
mkdir -p /opt/java/openjdk8; \
2121
cd /opt/java/openjdk8; \

ci/openjdk15-8-cassandra-3.11/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN set -eux; \
1515
useradd -d /home/jenkins-docker -m -u 1001 -U jenkins-docker;
1616

1717
RUN set -eux; \
18-
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz'; \
18+
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz'; \
1919
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
2020
mkdir -p /opt/java/openjdk8; \
2121
cd /opt/java/openjdk8; \

0 commit comments

Comments
 (0)