From ee77b055d98e60efc70dbfa0b3ba58886e2d105f Mon Sep 17 00:00:00 2001 From: ametgud4u <64977602+ametgud4u@users.noreply.github.com> Date: Fri, 21 May 2021 11:39:00 -0700 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) 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' - } } -} +} +}