mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:35: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
|
#!groovy
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none stages {
|
||||||
stages {
|
|
||||||
stage('Maven Install') {
|
stage('Maven Install') {
|
||||||
agent any
|
agent any
|
||||||
steps {
|
steps {
|
||||||
sh 'mvn clean install'
|
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