mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 16:25:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
f111398d8a
commit
783341f10a
1 changed files with 19 additions and 4 deletions
23
Jenkinsfile
vendored
23
Jenkinsfile
vendored
|
@ -1,12 +1,27 @@
|
|||
#!groovy
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
stages {
|
||||
agent none stages {
|
||||
stage('Maven Install') {
|
||||
agent any
|
||||
steps {
|
||||
agent any
|
||||
steps {
|
||||
sh 'mvn clean install'
|
||||
}
|
||||
}
|
||||
stage('Docker Build') {
|
||||
agent any
|
||||
steps {
|
||||
sh 'docker build -t shanem/spring-petclinic:latest .'
|
||||
}
|
||||
}
|
||||
stage('Docker Push') {
|
||||
agent any
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
|
||||
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
|
||||
sh 'docker push shanem/spring-petclinic:latest'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue