diff --git a/README.adoc b/README.adoc index a273ee9ce..5373dfafe 100644 --- a/README.adoc +++ b/README.adoc @@ -29,6 +29,8 @@ buildPlugin() execute the steps against in parallel * `jenkinsVersions`: (default: `[null]`) - a matrix of Jenkins baseline versions to build/test against in parallel (null means default, only available for Maven projects) +* `allowEmptyTestResults` (default: `false`) - Do not fail the build if the test results are missing. + It may be used for components which have no tests within the repo Usage: @@ -38,6 +40,23 @@ Usage: buildPlugin(platforms: ['linux'], jdkVersions: [7, 8]) ---- +=== buildModule + +This is a wrapper command for building Jenkins modules. +Currently the logic is similar to `buildPlugin()`, but it may change in the future. + +Usage: + +.Jenkinsfile +[source,groovy] +---- +buildModule() +---- + +==== Optional arguments + +The command offers the same options as `buildPlugin()`. + === infra.isTrusted() Determine whether the Pipeline is executing in an internal "trusted" Jenkins diff --git a/vars/buildModule.groovy b/vars/buildModule.groovy new file mode 100644 index 000000000..78eed478c --- /dev/null +++ b/vars/buildModule.groovy @@ -0,0 +1,5 @@ +#!/usr/bin/env groovy + +def call(Map params = [:]) { + buildPlugin(params) +} diff --git a/vars/buildModule.txt b/vars/buildModule.txt new file mode 100644 index 000000000..73cfdee8f --- /dev/null +++ b/vars/buildModule.txt @@ -0,0 +1,7 @@ +

+ Builds a Jenkins module following a standard build/test/archive pattern. See repository description for usage. +

+ + diff --git a/vars/buildPlugin.groovy b/vars/buildPlugin.groovy index a3d6b0368..3c4f98d28 100644 --- a/vars/buildPlugin.groovy +++ b/vars/buildPlugin.groovy @@ -9,6 +9,8 @@ def call(Map params = [:]) { def jenkinsVersions = params.containsKey('jenkinsVersions') ? params.jenkinsVersions : [null] def repo = params.containsKey('repo') ? params.repo : null def failFast = params.containsKey('failFast') ? params.failFast : true + def allowEmptyTestResults = params.containsKey('allowEmptyTestResults') ? params.allowEmptyTestResults : false + Map tasks = [failFast: failFast] for (int i = 0; i < platforms.size(); ++i) { for (int j = 0; j < jdkVersions.size(); ++j) { @@ -98,7 +100,7 @@ def call(Map params = [:]) { } timestamps { - junit testReports + junit allowEmptyResults: allowEmptyTestResults, testResults: testReports if (failFast && currentBuild.result == 'UNSTABLE') { error 'There were test failures; halting early' }