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