Set env for tag and version

This commit is contained in:
Jim Nicholson 2024-02-12 21:17:34 -08:00
parent 1873a535a9
commit 3a5cbb4d4d

View File

@ -13,6 +13,7 @@ void call(Map config = [:], Closure body = { }) {
if (runConfig.saveArtifacts) {
assert runConfig.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
}
withEnv(["TAG=${runConfig.gitTag}", "HASH=${runConfig.gitHash}", "VERSION=${version}"]) {
if ( fileExists(runConfig.buildRequires)) {
sh """
${runConfig.buildCmd}
@ -20,6 +21,8 @@ void call(Map config = [:], Closure body = { }) {
} else {
error("ERROR: File ${runConfig.buildRequires} does not exist in workspace.")
}
body()
}
if (runConfig.saveArtifacts) {
artifactsList = runConfig.artifacts.join(',')
archiveArtifacts artifacts: artifactsList, followSymlinks: false