diff --git a/Jenkinsfile b/Jenkinsfile index e39d731..93be07a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -128,16 +128,15 @@ gitAuth(env.GIT_CRED, { currentVersion = gitLastTag() }) - if (lazyConfig['branch'] == releaseBranch) { - // Checkout the last changes from the tag created in release stage - sh("git checkout tags/${currentVersion}") - } else { + if (lazyConfig['branch'] != releaseBranch) { // Write version from last tag to generate the site writeFile(encoding: 'UTF-8', file: 'version.txt', text: currentVersion) } currentBuild.displayName = "#${env.BUILD_NUMBER} ${currentVersion}" }, run: { + // Update package metadata to the current version + def currentVersion = readFile(encoding: 'UTF-8', file: 'version.txt') sh "mkdir -p ${env.BUILD_DIR} && echo 'testpkg-${currentVersion}' > ${env.BUILD_DIR}/\${LAZY_LABEL}.pkg" }, post: {