zallery/Jenkinsfile

34 lines
906 B
Text
Raw Normal View History

2016-12-12 17:44:37 +01:00
// Jenkinsfile (Pipeline Script)
2016-12-12 17:41:31 +01:00
node {
2016-12-20 17:07:07 +01:00
// Configure environment
//env.JAVA_HOME = tool name: 'JDK8'
env.REPO_URL = "repo.koc.se/zallery.git"
env.BUILD_NAME = "BUILD-" + env.BUILD_ID
2016-12-12 17:41:31 +01:00
checkout scm
stage('Build') {
sh 'ant clean'
sh 'ant build'
}
stage('Package') {
2016-12-20 17:07:07 +01:00
sh 'ant package'
archiveArtifacts artifacts: 'build/release/*', fingerprint: true
2016-12-12 17:41:31 +01:00
2016-12-20 17:07:07 +01:00
// 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}"
}
2016-12-12 17:41:31 +01:00
}
}
2016-12-20 17:07:07 +01:00
stage('Deploy') {
input 'Deploy?', submitter 'Administrator'
sh 'ant deploy'
}