Test
This commit is contained in:
parent
263ee996ec
commit
6573134d26
@ -4,18 +4,21 @@ import groovy.transform.Field
|
||||
|
||||
@Field
|
||||
Map defaults = [
|
||||
saveArtifaces: false,
|
||||
buildTest: 'Makefile',
|
||||
buildCmd: 'make all'
|
||||
]
|
||||
|
||||
def call(Map config = [:]) {
|
||||
assert config.artifacts : 'must specify artifacts!'
|
||||
Map runConfig = defaults + config
|
||||
if (runConfig.saveArtifacts) {
|
||||
assert config.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
|
||||
}
|
||||
if ( fileExists(runConfig.buildTest)) {
|
||||
sh """
|
||||
${runConfig.buildCmd}
|
||||
"""
|
||||
} else {
|
||||
echo "Skipping buildStep since ${runConfig.buildTest} does not exist in workspace."
|
||||
error("ERROR: File ${runConfig.buildTest} does not exist in workspace.")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user