diff --git a/Jenkinsfile b/Jenkinsfile index 84410f4..73239f1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,12 +62,12 @@ env: [ RELEASE: false, DRYRUN: false, - VERSION: '0.0.1', BUILD_DIR: 'target', + GIT_CRED: 'bot-ci-dgm', DEPLOY_USER: 'root', DEPLOY_HOST_STST: 'bxtsvctwas002.boxtel', DEPLOY_DIR: '/var/www/html/public/dummy-jenkins-pl', - DEPLOY_CRED: 'bot-ci-dgm', + DEPLOY_CRED: 'bot-ci-dgm-rsa', ], inLabels: [ 'ubuntu-16', 'centos-7' ], onLabels: [ default: 'master', docker: 'docker', mac: 'mac', android: 'android', ], @@ -141,7 +141,7 @@ tasks = [ pre: { def currentVersion = readFile(encoding: 'UTF-8', file: 'version.txt') - gitAuth('bot-ci-dgm', { + gitAuth(env.GIT_CRED, { // Define next version based on optional input // TODO: impelement/import a generic helper for semantic versionning def nextVersion = 'new' @@ -155,6 +155,8 @@ writeFile(encoding: 'UTF-8', text: nextVersion, file: 'version.txt') gitCommit("Update version to ${nextVersion}", 'version.txt') }) + currentVersion = readFile(encoding: 'UTF-8', file: 'version.txt') + currentBuild.displayName = "#${env.BUILD_NUMBER} ${currentVersion}" unarchive(mapping:["${env.BUILD_DIR}/" : '.']) }, run: { @@ -163,7 +165,8 @@ echo("Rebuild for version ${currentVersion}") }, post: { - gitAuth('bot-ci-dgm', { + def currentVersion = readFile(encoding: 'UTF-8', file: 'version.txt') + gitAuth(env.GIT_CRED, { gitTag("${currentVersion}", remote) gitPush(remote, releaseBranch) }) @@ -180,9 +183,7 @@ tasks = [ [ pre: { - echo "Unarchiving packages" unarchive(mapping:["${env.BUILD_DIR}/" : '.']) - sh("ls -lA target/packages") }, run: { echo "Creating repo with packages"