Update buildStep

This commit is contained in:
Jim Nicholson 2024-02-09 00:08:12 -08:00
parent 6992c88fb9
commit 9f2eed96a9

View File

@ -3,7 +3,7 @@
void call(Map config = [:], Closure body = { }) {
Map defaults = [
saveArtifaces: false,
buildTest: 'Makefile',
buildRequires: 'Makefile',
buildCmd: 'make all',
stepName: 'Build'
]
@ -13,12 +13,12 @@ void call(Map config = [:], Closure body = { }) {
if (runConfig.saveArtifacts) {
assert runConfig.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
}
if ( fileExists(runConfig.buildTest)) {
if ( fileExists(runConfig.buildRequires)) {
sh """
${runConfig.buildCmd}
"""
} else {
error("ERROR: File ${runConfig.buildTest} does not exist in workspace.")
error("ERROR: File ${runConfig.buildRequires} does not exist in workspace.")
}
if (runConfig.saveArtifacts) {
artifactsList = runConfig.artifacts.join(',')