fixed CI issues with maven

This commit is contained in:
Ziver Koc 2017-10-06 17:13:45 +02:00
parent 651a285a14
commit c15d9bb659

13
Jenkinsfile vendored
View file

@ -1,21 +1,22 @@
#!groovy
#!groovy
// Jenkinsfile (Pipeline Script)
node {
// Configure environment
env.REPO_URL = "repo.koc.se/zutil-java.git" //scm.getUserRemoteConfigs()[0].getUrl()
env.BUILD_NAME = "BUILD-" + env.BUILD_ID
stage('Checkout') {
git url: "https://" + env.REPO_URL
}
checkout scm
withMaven(JDK: "JDK8") {
withMaven(jdk: "jdk8", maven: "m3.5", mavenLocalRepo: ".repository") {
stage('Build') {
sh 'mvn clean compile'
}
stage('Test') {
sh 'mvn surefire:test failsafe:integration-test'
sh 'mvn test'
}
stage('Package') {
@ -23,7 +24,7 @@ node {
// Tag artifact
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh "git tag ${env.BUILD_NAME}"
sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}"
}