2020-04-21 09:20:09 +02:00
|
|
|
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
|
|
|
|
|
2018-11-02 11:57:18 +01:00
|
|
|
stage('Source') {
|
|
|
|
node {
|
|
|
|
sh 'setup_centreon_build.sh'
|
|
|
|
dir('centreon-plugins') {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
sh './centreon-build/jobs/plugins/plugins-source.sh'
|
|
|
|
source = readProperties file: 'source.properties'
|
|
|
|
env.VERSION = "${source.VERSION}"
|
|
|
|
env.RELEASE = "${source.RELEASE}"
|
2021-07-06 10:14:28 +02:00
|
|
|
// Run sonarQube analysis
|
|
|
|
withSonarQubeEnv('SonarQubeDev') {
|
|
|
|
sh './centreon-build/jobs/plugins/plugins-analysis.sh'
|
2018-12-10 11:38:29 +01:00
|
|
|
}
|
2018-11-02 11:57:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2021-07-06 17:23:42 +02:00
|
|
|
// sonarQube step to get qualityGate result
|
2021-07-06 10:14:28 +02:00
|
|
|
stage('Quality gate') {
|
|
|
|
node {
|
2021-07-06 17:23:42 +02:00
|
|
|
def qualityGate = waitForQualityGate()
|
|
|
|
if (qualityGate.status != 'OK') {
|
|
|
|
currentBuild.result = 'FAIL'
|
2021-07-06 10:14:28 +02:00
|
|
|
}
|
|
|
|
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
|
|
|
|
error("Quality gate failure: ${qualityGate.status}.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-02 11:57:18 +01:00
|
|
|
stage('Package') {
|
2018-11-07 13:55:01 +01:00
|
|
|
parallel 'all': {
|
2018-11-02 11:57:18 +01:00
|
|
|
node {
|
|
|
|
sh 'setup_centreon_build.sh'
|
2018-11-07 13:55:01 +01:00
|
|
|
sh './centreon-build/jobs/plugins/plugins-package.sh'
|
2018-11-02 11:57:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
|
|
|
|
error('Package stage failure.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch(e) {
|
|
|
|
if (env.BRANCH_NAME == 'master') {
|
|
|
|
slackSend channel: "#monitoring-metrology", color: "#F30031", message: "*FAILURE*: `CENTREON PLUGINS` <${env.BUILD_URL}|build #${env.BUILD_NUMBER}> on branch ${env.BRANCH_NAME}\n*COMMIT*: <https://github.com/centreon/centreon-plugins/commit/${source.COMMIT}|here> by ${source.COMMITTER}\n*INFO*: ${e}"
|
|
|
|
}
|
|
|
|
}
|