forked from centreon/centreon-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
109 lines (105 loc) · 3.13 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
stage('Source') {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
dir('centreon-web') {
checkout scm
}
sh '/opt/centreon-build/jobs/web/current/mon-web-source.sh'
source = readProperties file: 'source.properties'
env.VERSION = "${source.VERSION}"
env.RELEASE = "${source.RELEASE}"
}
}
stage('Unit tests') {
parallel 'centos6': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-unittest.sh centos6'
}
},
'centos7': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-unittest.sh centos7'
step([
$class: 'hudson.plugins.checkstyle.CheckStylePublisher',
pattern: '**/codestyle.xml',
usePreviousBuildAsReference: true,
useDeltaValues: true,
failedNewAll: '0'
])
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Unit tests stage failure.');
}
}
stage('Package') {
parallel 'centos6': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-package.sh centos6'
}
},
'centos7': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-package.sh centos7'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}
stage('Bundle') {
parallel 'centos6': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-bundle.sh centos6'
}
},
'centos7': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-bundle.sh centos7'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Bundle stage failure.');
}
}
stage('Acceptance tests') {
parallel 'centos6': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-acceptance.sh centos6'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
])
archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
}
},
'centos7': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/current/mon-web-acceptance.sh centos7'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
])
archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Acceptance tests stage failure.');
}
}