mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Duplicate Jenkins file
This commit is contained in:
parent
67f1d541cc
commit
ea358e14ba
1 changed files with 39 additions and 0 deletions
39
Jenkinsfile_Original
Normal file
39
Jenkinsfile_Original
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!groovy
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent none
|
||||||
|
stages {
|
||||||
|
stage('Maven Install') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'maven:3.5.4-jdk-8-alpine'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'mvn clean install -Dmaven.test.skip=true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Run tests') {
|
||||||
|
agent any
|
||||||
|
steps {
|
||||||
|
sh 'mvn clean install -Dmaven.test.skip=true'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker Build') {
|
||||||
|
agent any
|
||||||
|
steps {
|
||||||
|
sh 'docker build -t sanjeev435/spring-petclinic:latest .'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Docker Push') {
|
||||||
|
agent any
|
||||||
|
steps {
|
||||||
|
withCredentials([usernamePassword(credentialsId: 'DOCKER_HUB_GLOBAL', passwordVariable: 'dockerHubPassword',
|
||||||
|
usernameVariable: 'dockerHubUser')]) {
|
||||||
|
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
|
||||||
|
sh 'docker push sanjeev435/spring-petclinic'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue