forked from centreon/centreon-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (57 loc) · 1.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
env.REF_BRANCH = 'master'
if ((env.BRANCH_NAME == env.REF_BRANCH)) {
env.BUILD = 'REFERENCE'
} else {
env.BUILD = 'CI'
}
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}"
// Run sonarQube analysis
withSonarQubeEnv('SonarQubeDev') {
sh './centreon-build/jobs/plugins/plugins-analysis.sh'
}
timeout(time: 10, unit: 'MINUTES') {
def qualityGate = waitForQualityGate()
if (qualityGate.status != 'OK') {
currentBuild.result = 'FAIL'
}
}
}
}
stage('RPM Packaging') {
parallel 'all': {
node {
sh 'setup_centreon_build.sh'
sh './centreon-build/jobs/plugins/plugins-package.sh'
archiveArtifacts artifacts: 'rpms-centos7.tar.gz'
//archiveArtifacts artifacts: 'rpms-centos8.tar.gz'
stash name: "rpms-centos7", includes: 'output-centos7/noarch/*.rpm'
//stash name: "rpms-centos8", includes: 'output-centos8/noarch/*.rpm'
sh 'rm -rf output'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}
stage('RPM Delivery') {
parallel 'all': {
node {
sh 'setup_centreon_build.sh'
unstash 'rpms-centos7'
//unstash 'rpms-centos8'
sh './centreon-build/jobs/plugins/plugins-delivery.sh'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}