From feec3779b9f0df1467d289c5263e2dff47433c23 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Tue, 25 Feb 2025 12:47:06 +0800 Subject: [PATCH] fix(pipeline): improve stash naming for artifacts in executeFreeleapsPipeline Signed-off-by: zhenyus --- first-class-pipeline/vars/executeFreeleapsPipeline.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy index 0548386f..8c2ee1cb 100644 --- a/first-class-pipeline/vars/executeFreeleapsPipeline.groovy +++ b/first-class-pipeline/vars/executeFreeleapsPipeline.groovy @@ -448,7 +448,9 @@ spec: log.info("Pipeline", "Stashing root directory for ${component.name}...") stash includes: "", name: "${component.name}-root" } else if (targetPathType.trim() == "dir") { - stash includes: "${artifact}/**", name: "${component.name}-${artifact}" + def stashName = artifact.replace('/', '-').replace('.', '-') + log.info("Pipeline", "Stashing directory ${artifact} for ${component.name}...") + stash includes: "${artifact}/**", name: "${stashName}-${artifact}" } else { stash includes: artifact, name: "${component.name}-${artifact}" } @@ -530,7 +532,9 @@ spec: if (artifact == '.' || artifact == './') { unstash "${component.name}-root" } else { - unstash "${component.name}-${artifact}" + def stashName = artifact.replace('/', '-').replace('.', '-') + log.info("Pipeline", "Fetch stashed directory ${artifact} for ${component.name}...") + unstash "${stashName}-${artifact}" } }