mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 13:55: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"
|
BUILD_IMAGE = "registry.lksnext.com/devsecops/maven-java-17:2.0"
|
||||||
SONAR_HOST_URL = "https://sonarqubeenterprise.devops.lksnext.com/"
|
SONAR_HOST_URL = "https://sonarqubeenterprise.devops.lksnext.com/"
|
||||||
SONAR_TOKEN = credentials('sonarenterprise-analysis-token')
|
SONAR_TOKEN = credentials('sonarenterprise-analysis-token')
|
||||||
|
SONAR_BRANCH = env.BRANCH_NAME
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Sonar') {
|
stage('Sonar') {
|
||||||
when {
|
|
||||||
environment name: 'JOB_ACTION', value: 'sonar'
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh '''
|
sh '''
|
||||||
|
@ -19,7 +17,7 @@ pipeline {
|
||||||
-v ./:/app \
|
-v ./:/app \
|
||||||
-v "/home/jenkins/.m2":"/home/jenkins/.m2" \
|
-v "/home/jenkins/.m2":"/home/jenkins/.m2" \
|
||||||
-e JOB_ACTION="compile" \
|
-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
|
$BUILD_IMAGE
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue