Set env for tag and version
This commit is contained in:
parent
1873a535a9
commit
3a5cbb4d4d
@ -13,12 +13,15 @@ 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!'
|
||||||
}
|
}
|
||||||
if ( fileExists(runConfig.buildRequires)) {
|
withEnv(["TAG=${runConfig.gitTag}", "HASH=${runConfig.gitHash}", "VERSION=${version}"]) {
|
||||||
sh """
|
if ( fileExists(runConfig.buildRequires)) {
|
||||||
${runConfig.buildCmd}
|
sh """
|
||||||
"""
|
${runConfig.buildCmd}
|
||||||
} else {
|
"""
|
||||||
error("ERROR: File ${runConfig.buildRequires} does not exist in workspace.")
|
} else {
|
||||||
|
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(',')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user