2016-12-19 15:56:30 +01:00
|
|
|
// Jenkinsfile (Pipeline Script)
|
|
|
|
|
node {
|
2016-12-19 16:16:39 +01:00
|
|
|
// Select JDK8
|
|
|
|
|
env.JAVA_HOME = tool name: 'JDK8'
|
|
|
|
|
echo "JDK installation path is: ${env.JAVA_HOME}"
|
|
|
|
|
|
2016-12-19 15:56:30 +01:00
|
|
|
checkout scm
|
|
|
|
|
|
2016-12-19 16:16:39 +01:00
|
|
|
|
2016-12-19 15:56:30 +01:00
|
|
|
stage('Build') {
|
|
|
|
|
sh 'ant clean'
|
|
|
|
|
sh 'ant build'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stage('Test') {
|
|
|
|
|
try {
|
|
|
|
|
sh 'ant test'
|
|
|
|
|
} finally {
|
|
|
|
|
step([$class: 'JUnitResultArchiver', testResults: 'build/reports/*.xml'])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stage('Package') {
|
|
|
|
|
sh 'ant package'
|
|
|
|
|
archiveArtifacts artifacts: 'build/release/Zutil.jar', fingerprint: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//stage('Deploy') {
|
|
|
|
|
// if (currentBuild.result == 'SUCCESS') {
|
|
|
|
|
// input 'Deploy?', submitter 'Administrator'
|
|
|
|
|
// sh 'ant deploy'
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|