mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:05:48 +00:00
Update Jenkinsfile
This commit is contained in:
parent
27d904196a
commit
8ccf5b22f5
1 changed files with 10 additions and 3 deletions
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
|
@ -33,11 +33,18 @@ pipeline {
|
|||
}
|
||||
stage('Push artifact to docker registry') {
|
||||
steps {
|
||||
withDockerRegistry(credentialsId: 'dockerhub_id') {
|
||||
sh "docker push rodley/pet-clinic:${BUILD_NUMBER}"
|
||||
}
|
||||
script {
|
||||
def dockerImage = docker.build("${env.IMAGE_NAME}", "-f ${env.DOCKERFILE_NAME} .")
|
||||
docker.withRegistry('', 'dockerhub-creds') {
|
||||
dockerImage.push()
|
||||
dockerImage.push("latest")
|
||||
}
|
||||
echo "Pushed Docker Image: ${env.IMAGE_NAME}"
|
||||
}
|
||||
sh "docker rmi ${env.IMAGE_NAME} ${env.IMAGE_NAME_LATEST}"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
echo 'Deploying....'
|
||||
|
|
Loading…
Reference in a new issue