Compare commits

..

No commits in common. "1e1b48685d4248c55bb31ba9a3a61bc8cfe6e907" and "91ba37cff2a4ec6ec91a36c9564c0cce57ed4861" have entirely different histories.

1 changed files with 4 additions and 6 deletions

10
Jenkinsfile vendored
View File

@ -30,23 +30,21 @@ pipeline {
stage ('Initialize variables') { stage ('Initialize variables') {
steps { steps {
script { script {
withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim() lastVersion = sh(script: "git describe --tags --abbrev=0", returnStdout: true).trim()
if (!lastVersion) { if (!lastVersion) {
lastVersion = "0.0.0" lastVersion = "0.0.0"
} }
sh "echo ${lastVersion}"
echo "Last version: ${lastVersion}"
def (major, minor, patch) = lastVersion.tokenize('.') def (major, minor, patch) = lastVersion.tokenize('.')
def newVersion = "${major}.${minor}.${patch.toInteger() + 1}" def newVersion = "${major}.${minor}.${patch.toInteger() + 1}"
echo "New version: ${newVersion}"
env.IMAGE_TAG = newVersion env.IMAGE_TAG = newVersion
env.NEW_VERSION = newVersion env.NEW_VERSION = newVersion
} }
} }
} }
}
stage ('Build docker image') { stage ('Build docker image') {
when { when {
expression { env.CHANGE_BRANCH?.startsWith('rc') } expression { env.CHANGE_BRANCH?.startsWith('rc') }
@ -99,7 +97,7 @@ pipeline {
"${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases"
""" """
echo "New release succeeded!" echo "New release succeeded!"
def context = "test-org/${env.IMAGE_NAME}/pipeline/pr-${env.CHANGE_TARGET}" def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() 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") notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, env.IMAGE_NAME, commitHash, "success")
} }