mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 16:45:48 +00:00
Update Jenkinsfile
This commit is contained in:
parent
ab91c3c4af
commit
7afaa3e07e
1 changed files with 7 additions and 5 deletions
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
@ -33,14 +33,16 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Push artifact to docker registry') {
|
stage('Push artifact to docker registry') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
withRegistry(credentialsID: 'dockerhub_id') {
|
||||||
docker.withRegistry('', 'dockerhub_id') {
|
sh """#!/bin/bash -xe
|
||||||
dockerImage.push()
|
|
||||||
dockerImage.push("latest")
|
docker push()
|
||||||
|
Image push("latest")
|
||||||
}
|
}
|
||||||
echo "Pushed Docker Image: ${env.IMAGE_NAME}"
|
echo "Pushed Docker Image: ${env.IMAGE_NAME}"
|
||||||
}
|
}
|
||||||
sh "docker rmi ${env.IMAGE_NAME} ${env.IMAGE_NAME_LATEST}"
|
docker rmi ${env.IMAGE_NAME} ${env.IMAGE_NAME_LATEST}
|
||||||
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue