mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 06:25:50 +00:00
Add sonar branch
This commit is contained in:
parent
feee952e5e
commit
1adc1e07c5
1 changed files with 2 additions and 4 deletions
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
@ -6,12 +6,10 @@ pipeline {
|
|||
BUILD_IMAGE = "registry.lksnext.com/devsecops/maven-java-17:2.0"
|
||||
SONAR_HOST_URL = "https://sonarqubeenterprise.devops.lksnext.com/"
|
||||
SONAR_TOKEN = credentials('sonarenterprise-analysis-token')
|
||||
SONAR_BRANCH = env.BRANCH_NAME
|
||||
}
|
||||
stages {
|
||||
stage('Sonar') {
|
||||
when {
|
||||
environment name: 'JOB_ACTION', value: 'sonar'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
sh '''
|
||||
|
@ -19,7 +17,7 @@ pipeline {
|
|||
-v ./:/app \
|
||||
-v "/home/jenkins/.m2":"/home/jenkins/.m2" \
|
||||
-e JOB_ACTION="compile" \
|
||||
-e MAVEN_CMD="clean verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.token=$SONAR_TOKEN" \
|
||||
-e MAVEN_CMD="clean verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.token=$SONAR_TOKEN -Dsonar.branch.name=$SONAR_BRANCH" \
|
||||
$BUILD_IMAGE
|
||||
'''
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue