Changed Login Position in Jenkinsfile
All checks were successful
andreas-personal/jenkins-with-docker/pipeline/head This commit looks good

This commit is contained in:
Andreas Fahrecker 2024-03-12 18:11:55 +01:00
parent b69b687cf5
commit 69229171a7

10
Jenkinsfile vendored
View File

@ -16,6 +16,11 @@ pipeline {
DOCKER_HUB_CREDENTIALS = credentials('docker-hub-fah16145')
}
stages {
stage('Login') {
steps {
sh 'docker login -u ${DOCKER_HUB_CREDENTIALS_USR} -p ${DOCKER_HUB_CREDENTIALS_PSW}'
}
}
stage('Default Image') {
stages {
stage('Build') {
@ -23,11 +28,6 @@ pipeline {
sh 'docker build -t fah16145/jenkins-with-docker:latest .'
}
}
stage('Login') {
steps {
sh 'docker login -u ${DOCKER_HUB_CREDENTIALS_USR} -p ${DOCKER_HUB_CREDENTIALS_PSW}'
}
}
stage('Push') {
steps {
sh 'docker push fah16145/jenkins-with-docker:latest'