diff --git a/Jenkinsfile b/Jenkinsfile index 2e9ddf2..0e41373 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,11 +32,11 @@ pipeline { script { def hasTags = sh(script: "git tag -l | wc -l", returnStdout: true).trim().toInteger() > 0 echo "${hasTags}" + + def lastVersion = "0.0.0" + if (hasTags) { - def lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim() - } - if (!lastVersion) { - lastVersion = "0.0.0" + lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim() } echo "Last version: ${lastVersion}"