22 lines
482 B
Groovy
22 lines
482 B
Groovy
#!/usr/bin/env groovy
|
|
|
|
import groovy.transform.Field
|
|
|
|
@Field
|
|
Map defaults = [
|
|
buildTest: 'Makefile',
|
|
buildCmd: 'make all'
|
|
]
|
|
|
|
def call(Map config = [:]) {
|
|
assert config.artifacts : 'must specify artifacts!'
|
|
String runConfig = defaults + config
|
|
if ( fileExists("${runConfig.buildTest}")) {
|
|
sh """
|
|
${runConfig.buildCmd}
|
|
"""
|
|
} else {
|
|
echo "Skipping buildStep since ${runConfig.buildTest} does not exist in workspace."
|
|
}
|
|
}
|