diff --git a/Jenkinsfile b/Jenkinsfile index c20f30a95..895882120 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,24 +1,22 @@ -node('$hostname'){ +pipeline { + agent { + kubernetes { + label 'promo-app' // all your pods will be named with this prefix, followed by a unique id + idleMinutes 5 // how long the pod will live after no jobs have run on it + yamlFile 'build-pod.yaml' // path to the pod definition relative to the root of our project + defaultContainer 'maven' // define a default container if more than a few stages use it, will default to jnlp container + } + } + stages { stage('scm'){ - git 'https://github.com/ametgud4u/spring-petclinic.git' + steps { + git 'https://github.com/spring-projects/spring-petclinic.git' } - - stage('build'){ - sh label: '', script: 'mvn clean package' } - - stage('Sonar') { - withSonarQubeEnv('sonar') { - sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar' + stage('Build'){ + steps { + sh 'mvn clean package' } - - stage('postbuild'){ - junit '**/target/surefire-reports/*.xml' - archiveArtifacts 'target/*.jar' - } - - stage('Create Docker Image ') { - sh '${WORKSPACE}/SpringPetClinic-Piple/BuildImage.sh' - } } -} +} +}