fix(pipeline): improve stash naming for artifacts in executeFreeleapsPipeline

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-25 12:47:06 +08:00
parent 50758acc84
commit feec3779b9

View File

@ -448,7 +448,9 @@ spec:
log.info("Pipeline", "Stashing root directory for ${component.name}...") log.info("Pipeline", "Stashing root directory for ${component.name}...")
stash includes: "", name: "${component.name}-root" stash includes: "", name: "${component.name}-root"
} else if (targetPathType.trim() == "dir") { } 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 { } else {
stash includes: artifact, name: "${component.name}-${artifact}" stash includes: artifact, name: "${component.name}-${artifact}"
} }
@ -530,7 +532,9 @@ spec:
if (artifact == '.' || artifact == './') { if (artifact == '.' || artifact == './') {
unstash "${component.name}-root" unstash "${component.name}-root"
} else { } else {
unstash "${component.name}-${artifact}" def stashName = artifact.replace('/', '-').replace('.', '-')
log.info("Pipeline", "Fetch stashed directory ${artifact} for ${component.name}...")
unstash "${stashName}-${artifact}"
} }
} }