More defaults
This commit is contained in:
parent
c716586e0d
commit
b10fe3a4eb
@ -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."
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user