Files
CrossJeeves/Jenkinsfile
Flare Microsystems 5017e1b9ec Fail on test failure
2024-11-08 19:41:00 -08:00

40 lines
890 B
Groovy

pipeline {
environment {
JAVA_HOME = '/tool/jdk1.6.0_45'
ANT_HOME = '/tool/ant1.7.1'
}
agent any
stages {
stage('Compile'){
steps {
sh "$ANT_HOME/bin/ant compile compile_tests"
}
}
stage('Test'){
steps {
sh "$ANT_HOME/bin/ant test"
junit 'reports/*.xml'
script{
if (currentBuild.result == 'UNSTABLE')
{
currentBuild.result = 'FAILURE'
error('Tests failed, failing the build!')
}
}
}
}
stage('Package'){
steps {
sh "$ANT_HOME/bin/ant create_run_jar"
}
}
stage('Archive Artifacts')
{
when {triggeredBy 'UserIdCause'}
steps{
archiveArtifacts artifacts: 'CrossJeeves.jar'
}
}
}
}