some jenkins changes

This commit is contained in:
Ziver Koc 2016-12-20 17:07:07 +01:00
parent a322447fcb
commit 0ede74fd5a

35
Jenkinsfile vendored
View file

@ -1,5 +1,11 @@
// Jenkinsfile (Pipeline Script) // Jenkinsfile (Pipeline Script)
node { node {
// Configure environment
//env.JAVA_HOME = tool name: 'JDK8'
env.REPO_URL = "repo.koc.se/zallery.git"
env.BUILD_NAME = "BUILD-" + env.BUILD_ID
checkout scm checkout scm
stage('Build') { stage('Build') {
@ -7,24 +13,21 @@ node {
sh 'ant build' sh 'ant build'
} }
//stage('Test') {
// try {
// sh 'ant test'
// } finally {
// step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml'])
// }
//}
stage('Package') { stage('Package') {
sh 'ant package' sh 'ant package'
archiveArtifacts artifacts: 'build/release/Zallery.war', fingerprint: true archiveArtifacts artifacts: 'build/release/*', fingerprint: true
}
// Tag artifact
stage('Deploy') { withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491',
input message: 'Deploy?', submitter: 'ziver' usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh 'ant deploy' sh "git tag ${env.BUILD_NAME}"
sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}"
}
} }
} }
stage('Deploy') {
input 'Deploy?', submitter 'Administrator'
sh 'ant deploy'
}