More defaults
This commit is contained in:
parent
c716586e0d
commit
b10fe3a4eb
@ -4,16 +4,18 @@ import groovy.transform.Field
|
||||
|
||||
@Field
|
||||
Map defaults = [
|
||||
buildTest: 'Makefile',
|
||||
buildCmd: 'make all'
|
||||
]
|
||||
|
||||
|
||||
def call(Map config = [:]) {
|
||||
assert config.artifacts : 'must specify artifacts!'
|
||||
|
||||
config = defaults + config
|
||||
if ( fileExists(config.buildCmd)) {
|
||||
sh 'make'
|
||||
String runConfig = defaults + config
|
||||
if ( fileExists(runConfig.buildTest)) {
|
||||
sh """
|
||||
${runConfig.buildCmd}
|
||||
"""
|
||||
} else {
|
||||
echo "Skipping buildStep since ${runConfig.buildTest} does not exist in workspace."
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user