More defaults

This commit is contained in:
Jim Nicholson 2024-02-01 01:40:36 -08:00
parent c716586e0d
commit b10fe3a4eb

View File

@ -4,16 +4,18 @@ import groovy.transform.Field
@Field @Field
Map defaults = [ Map defaults = [
buildTest: 'Makefile',
buildCmd: 'make all' buildCmd: 'make all'
] ]
def call(Map config = [:]) { def call(Map config = [:]) {
assert config.artifacts : 'must specify artifacts!' assert config.artifacts : 'must specify artifacts!'
String runConfig = defaults + config
config = defaults + config if ( fileExists(runConfig.buildTest)) {
if ( fileExists(config.buildCmd)) { sh """
sh 'make' ${runConfig.buildCmd}
"""
} else {
echo "Skipping buildStep since ${runConfig.buildTest} does not exist in workspace."
} }
} }