Update Jenkinsfile

This commit is contained in:
ametgud4u 2021-05-21 11:39:00 -07:00 committed by GitHub
parent d85616540d
commit ee77b055d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

36
Jenkinsfile vendored
View file

@ -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'
}
}
}
}
}