diff --git a/Jenkinsfile b/Jenkinsfile index a61f5ba..e5eaa7a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ pipeline { NPM_CREDENTIALS = credentials('npm-publish') GIT_CREDENTIALS = credentials('jenkins_git') NPM_MAIL = 'info@nclazz.de' + TAG_NAME = sh(script: "git fetch --all --tags -q && git describe --tags --exact-match 2> /dev/null || echo ''", returnStdout: true).trim() } stages { stage('Prepare') { @@ -12,8 +13,8 @@ pipeline { echo """ NPM_REGISTRY : $env.NPM_REGISTRY NPM_MAIL : $env.NPM_MAIL - BRANCH : $BRANCH_NAME - TAG : $TAG_NAME + BRANCH_NAME : $BRANCH_NAME + TAG_NAME : $TAG_NAME """ sh 'npm install' sh('git remote set-url origin \$(echo $GIT_URL | sed -e "s^//^//$GIT_CREDENTIALS@^")')