From 40d7d39f1969f36037596c9d5dec82a26a521e4a Mon Sep 17 00:00:00 2001 From: Jim Nicholson Date: Thu, 1 Feb 2024 02:35:42 -0800 Subject: [PATCH] Add artifact saveing --- vars/buildStep.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vars/buildStep.groovy b/vars/buildStep.groovy index 93fb610..f8545cd 100644 --- a/vars/buildStep.groovy +++ b/vars/buildStep.groovy @@ -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 + } }