1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-02-05 13:25:19 +02:00

Fix stashing of piper binary (#1764)

* Update piperExecuteBin.groovy

* update tests
This commit is contained in:
Oliver Nocon 2020-07-06 13:22:36 +02:00 committed by GitHub
parent 12e1ff0c60
commit 520f2cc975
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -376,6 +376,6 @@ class PiperExecuteBinTest extends BasePiperTest {
[] []
) )
assertThat(dockerExecuteRule.dockerParams.stashContent, is(["buildDescriptor", "pipelineConfigAndTests"])) assertThat(dockerExecuteRule.dockerParams.stashContent, is(["buildDescriptor", "pipelineConfigAndTests", "piper-bin"]))
} }
} }

View File

@ -53,6 +53,7 @@ void call(Map parameters = [:], String stepName, String metadataFile, List crede
// then make sure that commonPipelineEnvironment, config, ... is also available when step stashing is active // then make sure that commonPipelineEnvironment, config, ... is also available when step stashing is active
if (config.stashContent?.size() > 0) { if (config.stashContent?.size() > 0) {
config.stashContent.add('pipelineConfigAndTests') config.stashContent.add('pipelineConfigAndTests')
config.stashContent.add('piper-bin')
} }
if (parameters.stashNoDefaultExcludes) { if (parameters.stashNoDefaultExcludes) {
@ -63,6 +64,7 @@ void call(Map parameters = [:], String stepName, String metadataFile, List crede
dockerWrapper(script, config) { dockerWrapper(script, config) {
handleErrorDetails(stepName) { handleErrorDetails(stepName) {
script.commonPipelineEnvironment.writeToDisk(script)
credentialWrapper(config, credentialInfo) { credentialWrapper(config, credentialInfo) {
sh "${piperGoPath} ${stepName}${defaultConfigArgs}${customConfigArg}" sh "${piperGoPath} ${stepName}${defaultConfigArgs}${customConfigArg}"
} }
@ -78,7 +80,6 @@ static void prepareExecution(Script script, Utils utils, Map parameters = [:]) {
def piperGoUtils = parameters.piperGoUtils ?: new PiperGoUtils(script, utils) def piperGoUtils = parameters.piperGoUtils ?: new PiperGoUtils(script, utils)
piperGoUtils.unstashPiperBin() piperGoUtils.unstashPiperBin()
utils.unstash('pipelineConfigAndTests') utils.unstash('pipelineConfigAndTests')
script.commonPipelineEnvironment.writeToDisk(script)
} }
static Map prepareStepParameters(Map parameters) { static Map prepareStepParameters(Map parameters) {