Moved Login step
Some checks failed
andreas-personal/jenkins-with-docker/pipeline/head There was a failure building this commit

This commit is contained in:
Andreas Fahrecker 2024-03-12 16:50:05 +01:00
parent 225469414f
commit 8697b2880c

10
Jenkinsfile vendored
View File

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