diff --git a/Jenkinsfile b/Jenkinsfile index 1768078..6fc3e41 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,18 +30,20 @@ pipeline { stage ('Initialize variables') { steps { script { - withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) { lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim() if (!lastVersion) { lastVersion = "0.0.0" } - sh "echo ${lastVersion}" + + echo "Last version: ${lastVersion}" + def (major, minor, patch) = lastVersion.tokenize('.') def newVersion = "${major}.${minor}.${patch.toInteger() + 1}" + echo "New version: ${newVersion}" + env.IMAGE_TAG = newVersion env.NEW_VERSION = newVersion - } } } }