blob: c1e0090e6a1a741917778a0322b2b443802d4edd [file] [log] [blame]
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08001//////////////////////
2
3stage 'Checkout from git'
4node {
5 deleteDir()
6 git url: 'http://gerrit.named-data.net/ndn-tools'
7 sh "git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD"
8 stash name: 'code', includes: '**/*, .git/**/*', useDefaultExcludes: false
9}
10
11//////////////////////
12
13stage 'Parallel builds'
14
15def labels = [
16 "OSX-10.12",
17 "Ubuntu-16.04-64bit",
18 "code-coverage"
19]
20
21def builds = [:]
22
23// Apparently, cannot use for-loop iteration, see https://issues.jenkins-ci.org/browse/JENKINS-27421
24for (int i = 0; i < labels.size(); i++) {
25 String label = labels.get(i);
26
27 builds[label] = {
28 node(label) {
29 wrap([$class: 'hudson.plugins.ansicolor.AnsiColorBuildWrapper', colorMapName: 'xterm']) {
30 deleteDir()
31 unstash "code"
32
33 sh "XUNIT=yes ./.jenkins"
34
35 if (label == "code-coverage") {
36 step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'build/coverage.xml', failNoReports: true, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
37 } else {
38 // don't publish test results for code coverage run
39 step([$class: 'XUnitBuilder', testTimeMargin: '50000', thresholdMode: 1, tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/xunit*.xml', skipNoTestFiles: true, stopProcessingIfError: true]]])
40 }
41 }
42 }
43 }
44}
45
46parallel builds