mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 16:25:49 +00:00
Jenkinsfile v1
This commit is contained in:
parent
2d70c74ad2
commit
91e6ee71d5
1 changed files with 33 additions and 0 deletions
33
Jenkinsfile
vendored
Normal file
33
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
pipeline {
|
||||||
|
|
||||||
|
agent any
|
||||||
|
|
||||||
|
options {
|
||||||
|
// Keep only 1 artifact, and many builds
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '1000', artifactNumToKeepStr: '0'))
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
|
||||||
|
stage('Build the code') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'openjdk:8-jdk-alpine'
|
||||||
|
args '-v $HOME/.m2:/root/.m2'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh './mvnw clean package'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Create image') {
|
||||||
|
steps {
|
||||||
|
sh 'docker build --pull -t loxon/petclinic:2.0.0 .'
|
||||||
|
sh 'docker push loxon/petclinic:2.0.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue