diff --git a/Jenkinsfile b/Jenkinsfile index b667703db..17252a91d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,20 +9,10 @@ node('build-slave') { ansiColor('xterm') { stage('Checkout') { cleanWs() - if(params.github_release_tag == ""){ - checkout scm - commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() - branch_name = sh(script: 'git name-rev --name-only HEAD | rev | cut -d "/" -f1| rev', returnStdout: true).trim() - build_tag = branch_name + "_" + commit_hash + "_" + env.BUILD_NUMBER - println(ANSI_BOLD + ANSI_YELLOW + "Tag not specified, using the latest commit hash: " + commit_hash + ANSI_NORMAL) - } - else { - def scmVars = checkout scm - checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/$params.github_release_tag"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]] - build_tag = params.github_release_tag + "_" + env.BUILD_NUMBER - println(ANSI_BOLD + ANSI_YELLOW + "Tag specified, building from tag: " + params.github_release_tag + ANSI_NORMAL) - } - echo "build_tag: "+ build_tag + checkout scm + commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + artifact_version = sh(script: "echo " + params.github_release_tag.split('/')[-1] + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim() + echo "artifact_version: "+ artifact_version } }