Skip to content

Commit

Permalink
Merge pull request #11 from Kaali09/secor-0.29
Browse files Browse the repository at this point in the history
 updated the JF as per new jenkins jobs parameter
  • Loading branch information
sowmya-dixit authored Apr 14, 2021
2 parents b684b95 + 312a71f commit a0a800c
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit a0a800c

Please sign in to comment.