zutil/Jenkinsfile
2017-10-06 16:37:36 +02:00

41 lines
1.1 KiB
Groovy
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!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
checkout scm
withMaven(JDK: "JDK8") {
stage('Build') {
sh 'mvn clean compile'
}
stage('Test') {
sh 'mvn surefire:test failsafe:integration-test'
}
stage('Package') {
sh 'mvn -DskipStatic -DskipTests install'
// Tag artifact
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh "git tag ${env.BUILD_NAME}"
sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}"
}
}
}
}
//stage('Deploy') {
// timeout(time: 5, unit: 'HOURS') {
// input message: 'Deploy?', submitter: 'ziver'
// node {
// sh 'mvn deploy'
// }
// }
//}