diff --git a/Jenkinsfile b/Jenkinsfile index 1768078..043440e 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 - } } } } @@ -97,7 +99,7 @@ pipeline { "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" """ echo "New release succeeded!" - def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}" + def context = "test-org/${env.IMAGE_NAME}/pipeline/pr-${env.CHANGE_TARGET}" def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, env.IMAGE_NAME, commitHash, "success") }