diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..1e6ac6996 --- /dev/null +++ b/Jenkinsfile @@ -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' + } + } + + } + +} \ No newline at end of file