Alexander Afanasyev | a9369b4 | 2017-01-11 11:58:00 -0800 | [diff] [blame^] | 1 | ////////////////////// |
| 2 | |
| 3 | stage 'Checkout from git' |
| 4 | node { |
| 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 | |
| 13 | stage 'Parallel builds' |
| 14 | |
| 15 | def labels = [ |
| 16 | "OSX-10.12", |
| 17 | "Ubuntu-16.04-64bit", |
| 18 | "code-coverage" |
| 19 | ] |
| 20 | |
| 21 | def builds = [:] |
| 22 | |
| 23 | // Apparently, cannot use for-loop iteration, see https://issues.jenkins-ci.org/browse/JENKINS-27421 |
| 24 | for (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 | |
| 46 | parallel builds |