From d21403ca1e08af90069222f7513b490719295190 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Fri, 11 Oct 2024 12:56:29 +1000 Subject: [PATCH] Move docker login in pipeline --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1d8680a..ae631f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,6 +56,13 @@ pipeline { sh 'sed -i -E "s/(version-)[0-9]+\\.[0-9]+\\.[0-9]+(-green)/\\1${BUILD_VERSION}\\2/" README.md' } } + stage('Docker Login') { + steps { + withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { + sh 'docker login -u "${duser}" -p "${dpass}"' + } + } + } } } stage('Builds') { @@ -157,10 +164,7 @@ pipeline { } } steps { - withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) { - sh 'docker login -u "${duser}" -p "${dpass}"' - sh "./scripts/buildx --push ${buildxPushTags}" - } + sh "./scripts/buildx --push ${buildxPushTags}" } } stage('Docs / Comment') {