mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 17:15:48 +00:00
Update Jenkinsfile
This commit is contained in:
parent
f8558af303
commit
174d2a134a
1 changed files with 6 additions and 11 deletions
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
|
@ -1,23 +1,18 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent none stages {
|
agent any
|
||||||
|
stages {
|
||||||
|
|
||||||
stage('Maven Install') {
|
stage('Maven Install') {
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'maven:3.5.0'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'mvn clean install'
|
sh 'mvn clean install'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docker Build') {
|
stage('Docker Build') {
|
||||||
agent any
|
|
||||||
steps {
|
steps {
|
||||||
sh 'docker build -t shanem/spring-petclinic:latest .'
|
sh 'docker build -t shanem/spring-petclinic:latest .'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docker Push') {
|
stage('Docker Push') {
|
||||||
agent any
|
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
|
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
|
||||||
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
|
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
|
||||||
|
|
Loading…
Reference in a new issue