Return name of package

This commit is contained in:
Jim Nicholson 2024-02-26 10:44:50 -08:00
parent b931480b1c
commit 2ff2a99368

View File

@ -1,6 +1,6 @@
#!/usr/bin/env groovy
void call(Map config = [:], Closure body = { }) {
String call(Map config = [:], Closure body = { }) {
Map defaults = [
name: env.BUILD_TAG,
archiveCmd: 'tar',
@ -11,6 +11,7 @@ void call(Map config = [:], Closure body = { }) {
separator: '-',
useHash: false
]
archiveName = ''
Map runConfig = defaults + config
stage(runConfig.stepName) {
printBanner(runConfig.stepName, [ boxStyle : 'plain' ])
@ -35,8 +36,13 @@ void call(Map config = [:], Closure body = { }) {
fi
"""
archiveArtifacts artifacts: archiveName, followSymlinks: false
withEnv(["TAG=${runConfig.tag}", "HASH=${runConfig.hash}", "VERSION=${runConfig.version}"]) {
body()
withEnv([
"TAG=${runConfig.tag}",
"HASH=${runConfig.hash}",
"VERSION=${runConfig.version}",
"ARCHIVE=${archiveName}"]) {
body()
}
}
return archiveName
}