forked from centreon/centreon-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
37 lines (35 loc) · 1.14 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
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}"
if (env.BRANCH_NAME == 'master') {
withSonarQubeEnv('SonarQube') {
sh './centreon-build/jobs/plugins/plugins-analysis.sh'
}
}
}
}
try {
stage('Package') {
parallel 'all': {
node {
sh 'setup_centreon_build.sh'
sh './centreon-build/jobs/plugins/plugins-package.sh'
}
}
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}"
}
}