From a8cef50b50e5e4e617671031cc592c6c33ece6e1 Mon Sep 17 00:00:00 2001 From: work Date: Wed, 5 Feb 2025 19:29:14 +0100 Subject: [PATCH] sdasd --- Jenkinsfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cf1213a31..fcd61ecf4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,15 +28,16 @@ pipeline { } } - stage('Login to dockerhub') { - steps { - docker.withRegistry('https://index.docker.io/v1/', 'piachsecki-dockerhub') { - echo 'Logged into DockerHub' - } - +stage('Login to dockerhub') { + steps { + withCredentials([usernamePassword(credentialsId: 'piachsecki-dockerhub', + usernameVariable: 'DOCKERHUB_USER', + passwordVariable: 'DOCKERHUB_PASS')]) { + sh 'echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USER --password-stdin' + } } +} - } stage('Push') { steps { sh 'docker push piachsecki/spring-pet-clinic:latest'