mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15:49 +00:00
sonarcloud
This commit is contained in:
parent
4450841107
commit
ae80653c53
1 changed files with 17 additions and 22 deletions
39
Jenkinsfile
vendored
39
Jenkinsfile
vendored
|
@ -1,7 +1,6 @@
|
|||
pipeline {
|
||||
agent {label 'JDK_17'}
|
||||
agent any
|
||||
options {
|
||||
retry(3)
|
||||
timeout(time: 30, unit: 'MINUTES')
|
||||
}
|
||||
triggers {
|
||||
|
@ -9,37 +8,33 @@ pipeline {
|
|||
}
|
||||
tools {
|
||||
jdk 'JDK_17'
|
||||
maven 'maven 3.9.4'
|
||||
maven 'MAVEN_HOME'
|
||||
}
|
||||
stages {
|
||||
stage('code') {
|
||||
stage ('vcs') {
|
||||
steps {
|
||||
git url: 'https://github.com/KVKR31/dummy.git' ,
|
||||
branch : 'main'
|
||||
git url: 'https://github.com/spring-projects/spring-petclinic.git',
|
||||
branch: 'main'
|
||||
}
|
||||
}
|
||||
stage('package') {
|
||||
stage ('SonarQube analysis') {
|
||||
steps {
|
||||
sh 'mvn package'
|
||||
// performing sonarqube analysis with "withSonarQubeENV(<Name of Server configured in Jenkins>)"
|
||||
withSonarQubeEnv ('SONAR_CLOUD') {
|
||||
// requires SonarQube Scanner for Maven 3.2+
|
||||
sh 'mvn clean package sonar:sonar \
|
||||
-Dsonar.organization=vinodreddy \
|
||||
-Dsonar.token=8c25ce4838b681386906760fda5459c4f80eedf6 \
|
||||
-Dsonar.projectKey=vinodreddy_spc'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('build') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: '**/target/spring-petclinic-*.jar'
|
||||
junit testResults : '**/target/surefire-reports/TEST-*.xml'
|
||||
junit testResults: '**/target/surefire-reports/TEST-*.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
mail subject: '${JOB_NAME}:: has completed with success',
|
||||
body: 'your project is effective \n Build Url ${BUILD_URL',
|
||||
to: 'vinod@gmail.com'
|
||||
}
|
||||
failure {
|
||||
mail subject: '${JOB_NAME}:: has completed with failed',
|
||||
body: 'your project is defective \n Build Url ${BUILD_URL',
|
||||
to: 'vinod@gmail.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue