From 2ac6b5e31181d40e2192bf25334ce121fc2067e0 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Mon, 19 Dec 2016 17:02:55 +0100 Subject: [PATCH] added build tagging --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b84c8e7..1cd695d 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,8 +22,15 @@ node { stage('Package') { - sh 'ant package' - archiveArtifacts artifacts: 'build/release/Zutil.jar', fingerprint: true + sh 'ant package' + archiveArtifacts artifacts: 'build/release/Zutil.jar', fingerprint: true + + // Tag artifact + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491', + usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { + sh "git tag BUILD-" + env.BUILD_ID + sh "git push 'https://${USERNAME}:${PASSWORD}@repo.koc.se/hal.git' --tags" + } }