Commit e4441b86 authored by sc979's avatar sc979 Committed by schapron
Browse files

enh(chore): add sonarQube pipeline (#32)

parent eea9b652
......@@ -70,32 +70,36 @@ stage('Source') {
}
try {
/* stage('Sonar analysis') {
parallel 'centos7': {
node {
sh 'setup_centreon_build.sh'
stage('Sonar analysis') {
node {
sh 'setup_centreon_build.sh'
/* unittest.sh does not exist currently. ADD the missing script before restoring this part
sh './centreon-build/jobs/connector/${serie}/mon-connector-unittest.sh centos7'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'GoogleTestType', pattern: 'ut.xml']]
])
sh "./centreon-build/jobs/connector/${serie}/mon-connector-unittest.sh centos7"
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'GoogleTestType', pattern: 'ut.xml']]
])
*/
if ((env.BUILD == 'RELEASE') || (env.BUILD == 'REFERENCE')) {
withSonarQubeEnv('SonarQubeDev') {
sh "./centreon-build/jobs/connector/${serie}/mon-connector-analysis.sh"
}
}
withSonarQubeEnv('SonarQubeDev') {
sh "./centreon-build/jobs/connector/${serie}/mon-connector-analysis.sh"
}
}
}
timeout(time: 10, unit: 'MINUTES') {
def qualityGate = waitForQualityGate()
if (qualityGate.status != 'OK') {
currentBuild.result = 'FAIL'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Unit tests stage failure.');
error("Quality gate failure: ${qualityGate.status}.");
}
}*/
}
stage('Package') {
parallel 'centos7': {
......
sonar.projectKey=centreon-connector-21.04
sonar.projectName=Centreon Connector 21.04
# project
sonar.projectKey={PROJECT_TITLE}
sonar.projectName={PROJECT_NAME}
sonar.projectVersion={PROJECT_VERSION}
sonar.sources=.
sonar.tsql.file.suffixes=sql,tsql
sonar.plsql.file.suffixes=pks,pkb
# mandatory to not fail the builds until build-wrapper is installed and sources are compiled
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
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