Skip to content

Commit d21403c

Browse files
committed
Move docker login in pipeline
1 parent c39d543 commit d21403c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Jenkinsfile

+8-4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ pipeline {
5656
sh 'sed -i -E "s/(version-)[0-9]+\\.[0-9]+\\.[0-9]+(-green)/\\1${BUILD_VERSION}\\2/" README.md'
5757
}
5858
}
59+
stage('Docker Login') {
60+
steps {
61+
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
62+
sh 'docker login -u "${duser}" -p "${dpass}"'
63+
}
64+
}
65+
}
5966
}
6067
}
6168
stage('Builds') {
@@ -157,10 +164,7 @@ pipeline {
157164
}
158165
}
159166
steps {
160-
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
161-
sh 'docker login -u "${duser}" -p "${dpass}"'
162-
sh "./scripts/buildx --push ${buildxPushTags}"
163-
}
167+
sh "./scripts/buildx --push ${buildxPushTags}"
164168
}
165169
}
166170
stage('Docs / Comment') {

0 commit comments

Comments
 (0)