Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions vars/buildModule.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env groovy

def call(Map params = [:]) {
buildPlugin(params)
}
7 changes: 7 additions & 0 deletions vars/buildModule.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p>
Builds a Jenkins module following a standard build/test/archive pattern. See repository description for usage.
</p>

<!--
vim: ft=html
-->
4 changes: 3 additions & 1 deletion vars/buildPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
}
Expand Down