diff --git a/Jenkinsfile b/Jenkinsfile index 73239f1..4e1c94c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -117,7 +117,8 @@ [ run: { echo "Building packages"; - sh "mkdir -p ${env.BUILD_DIR} && echo 'testpkg' > ${env.BUILD_DIR}/\${LAZY_LABEL}.pkg" + def currentVersion = readFile(encoding: 'UTF-8', file: 'version.txt') + sh "mkdir -p ${env.BUILD_DIR} && echo 'testpkg-${currentVersione}' > ${env.BUILD_DIR}/\${LAZY_LABEL}.pkg" }, in: [ 'ubuntu-16', 'centos-7', ], on: 'docker', @@ -136,7 +137,7 @@ // Ask version if release flag and set and we are in the branch to fork release from input = [ message: 'Version string', - parameters: [string(defaultValue: '', description: 'Version string to be use for the next release', name: 'VERSION')] + parameters: [string(defaultValue: '', description: 'Version string to release', name: 'VERSION')] ] tasks = [ pre: { @@ -144,9 +145,11 @@ gitAuth(env.GIT_CRED, { // Define next version based on optional input // TODO: impelement/import a generic helper for semantic versionning - def nextVersion = 'new' + def nextVersion = null if (env.lazyInput) { nextVersion = env.lazyInput + } else { + nextVersion = bumpVersion('build', currentVersion) } // Merge master into release branch gitMerge(workingBranch, releaseBranch)