Select Git revision
Jenkinsfile
Jenkinsfile 7.16 KiB
stage('Source') {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
dir('centreon-web') {
checkout scm
}
sh '/opt/centreon-build/jobs/web/3.5/mon-web-source.sh'
source = readProperties file: 'source.properties'
env.VERSION = "${source.VERSION}"
env.RELEASE = "${source.RELEASE}"
}
}
try {
stage('Unit tests') {
parallel 'centos6': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/3.5/mon-web-unittest.sh centos6'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
])
}
},
'centos7': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/3.5/mon-web-unittest.sh centos7'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
])
step([
$class: 'CloverPublisher',
cloverReportDir: '.',
cloverReportFileName: 'coverage.xml'
])
step([
$class: 'hudson.plugins.checkstyle.CheckStylePublisher',
pattern: 'codestyle.xml',
usePreviousBuildAsReference: true,
useDeltaValues: true,
failedNewAll: '0'
])
}
},
'debian9': {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
sh '/opt/centreon-build/jobs/web/3.5/mon-web-unittest.sh debian9'
step([
$class: 'XUnitBuilder',
thresholds: [
[$class: 'FailedThreshold', failureThreshold: '0'],
[$class: 'SkippedThreshold', failureThreshold: '0']
],
tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
])
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {