Unverified Commit 8f566ed0 authored by sc979's avatar sc979 Committed by GitHub
Browse files

enh(chore): integrate sonarQube dev edition (#31)

parent 2d56df1c
......@@ -4,6 +4,7 @@
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
def serie = '21.04'
def maintenanceBranch = "${serie}.x"
if (env.BRANCH_NAME.startsWith('release-')) {
env.BUILD = 'RELEASE'
} else if ((env.BRANCH_NAME == 'master') || (env.BRANCH_NAME == maintenanceBranch)) {
......@@ -76,10 +77,9 @@ try {
trendChartType: 'NONE'
)
if ((env.BUILD == 'RELEASE') || (env.BUILD == 'REFERENCE')) {
withSonarQubeEnv('SonarQube') {
sh "./centreon-build/jobs/widgets/${serie}/widget-analysis.sh"
}
// Run sonarQube analysis
withSonarQubeEnv('SonarQubeDev') {
sh "./centreon-build/jobs/widgets/${serie}/widget-analysis.sh"
}
}
}
......@@ -88,6 +88,19 @@ try {
}
}
// sonarQube step to get qualityGate result
stage('Quality gate') {
timeout(time: 10, unit: 'MINUTES') {
def qualityGate = waitForQualityGate()
if (qualityGate.status != 'OK') {
currentBuild.result = 'FAIL'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Quality gate failure: ${qualityGate.status}.');
}
}
stage('Package') {
parallel 'centos7': {
node {
......
sonar.projectKey=centreon-widget-global-health-21.04
sonar.projectName=Centreon Widget Global Health 21.04
# project
sonar.projectKey={PROJECT_TITLE}
sonar.projectName={PROJECT_NAME}
sonar.projectVersion={PROJECT_VERSION}
sonar.sources=./global-health
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment