Set env for tag and version
This commit is contained in:
parent
1873a535a9
commit
3a5cbb4d4d
@ -13,6 +13,7 @@ void call(Map config = [:], Closure body = { }) {
|
|||||||
if (runConfig.saveArtifacts) {
|
if (runConfig.saveArtifacts) {
|
||||||
assert runConfig.artifacts : 'Error: saveArtifacts is set to true; must specify artifacts!'
|
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)) {
|
if ( fileExists(runConfig.buildRequires)) {
|
||||||
sh """
|
sh """
|
||||||
${runConfig.buildCmd}
|
${runConfig.buildCmd}
|
||||||
@ -20,6 +21,8 @@ void call(Map config = [:], Closure body = { }) {
|
|||||||
} else {
|
} else {
|
||||||
error("ERROR: File ${runConfig.buildRequires} does not exist in workspace.")
|
error("ERROR: File ${runConfig.buildRequires} does not exist in workspace.")
|
||||||
}
|
}
|
||||||
|
body()
|
||||||
|
}
|
||||||
if (runConfig.saveArtifacts) {
|
if (runConfig.saveArtifacts) {
|
||||||
artifactsList = runConfig.artifacts.join(',')
|
artifactsList = runConfig.artifacts.join(',')
|
||||||
archiveArtifacts artifacts: artifactsList, followSymlinks: false
|
archiveArtifacts artifacts: artifactsList, followSymlinks: false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user