Add artifact saveing

This commit is contained in:
Jim Nicholson 2024-02-01 02:35:42 -08:00
parent 6573134d26
commit 40d7d39f19

View File

@ -12,7 +12,7 @@ Map defaults = [
def call(Map config = [:]) {
Map runConfig = defaults + config
if (runConfig.saveArtifacts) {
assert config.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
assert runConfig.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
}
if ( fileExists(runConfig.buildTest)) {
sh """
@ -21,4 +21,8 @@ def call(Map config = [:]) {
} else {
error("ERROR: File ${runConfig.buildTest} does not exist in workspace.")
}
if (runConfig.saveArtifacts) {
artifactsList = runConfig.artifacts.inspect()
archiveArtifacts artifacts: artifactsList, followSymlinks: false
}
}