mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 15:55:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
0a4d0fa2ca
commit
006858e2ea
1 changed files with 15 additions and 2 deletions
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
|
@ -23,7 +23,7 @@ pipeline {
|
|||
'''
|
||||
}
|
||||
}
|
||||
stage('CREATE ARTIFACT') {
|
||||
/* stage('CREATE ARTIFACT') {
|
||||
steps {
|
||||
echo 'Creating Docker Image...'
|
||||
sh """#!/bin/bash -xe
|
||||
|
@ -41,7 +41,20 @@ pipeline {
|
|||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
stage('Push images') {
|
||||
steps {
|
||||
script {
|
||||
def dockerImage = docker.build("${env.IMAGE_NAME}", "-f ${env.DOCKERFILE_NAME} .")
|
||||
docker.withRegistry('', 'dockerhub_id') {
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue