diff --git a/Jenkinsfile b/Jenkinsfile index a28b78a..fb8278a 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,13 @@ // Jenkinsfile (Pipeline Script) node { - // Select JDK8 + // Configure environment env.JAVA_HOME = tool name: 'JDK8' - echo "JDK installation path is: ${env.JAVA_HOME}" + env.REPO_URL = "repo.koc.se/zutil-java.git" //scm.getUserRemoteConfigs()[0].getUrl() + env.BUILD_NAME = "BUILD-" + env.BUILD_ID + checkout scm - stage('Build') { sh 'ant clean' sh 'ant build' @@ -23,14 +24,13 @@ node { stage('Package') { sh 'ant package' - archiveArtifacts artifacts: 'build/release/Zutil.jar', fingerprint: true + archiveArtifacts artifacts: 'build/release/*', fingerprint: true // Tag artifact withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { - tag = "BUILD-" + env.BUILD_ID - sh "git tag ${tag}" - sh "git push 'https://${USERNAME}:${PASSWORD}@repo.koc.se/hal.git' ${tag}" + sh "git tag ${env.BUILD_NAME}" + sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}" } }