jenkins: check version also on latest instead of only empty
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
ee9eb887c4
commit
f735db2610
|
|
@ -40,7 +40,7 @@ pipeline {
|
|||
stage('prepare') {
|
||||
steps {
|
||||
script {
|
||||
if("${params.RLS_VERSION}" != "") {
|
||||
if(isReleaseRequested("${params.RLS_VERSION}")) {
|
||||
sh 'git submodule update' // set all submodules to freezed commit
|
||||
}
|
||||
else {
|
||||
|
|
@ -89,9 +89,16 @@ pipeline {
|
|||
}
|
||||
|
||||
|
||||
def isReleaseRequested(versionParam) {
|
||||
if((versionParam == "") || (versionParam == "latest")) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
def build_version(versionParam) {
|
||||
def gitCmd = "git describe --tags"
|
||||
if(versionParam == "") {
|
||||
if(!isReleaseRequested(versionParam)) {
|
||||
gitCmd = "${gitCmd} --dirty"
|
||||
}
|
||||
gitversion = sh(returnStdout: true, script: "${gitCmd}").trim()
|
||||
|
|
|
|||
Loading…
Reference in New Issue