Some checks failed
Flare Microsystems Git/FlarePublic/CrossJeeves/pipeline/pr-master There was a failure building this commit
50 lines
1023 B
Groovy
50 lines
1023 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'
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
// Report success to Gitea
|
|
giteaSetCommitStatus(context: 'success', description: 'Build Passed', targetUrl: env.BUILD_URL)
|
|
}
|
|
failure {
|
|
// Report failure to Gitea
|
|
giteaSetCommitStatus(context: 'failure', description: 'Build Failed', targetUrl: env.BUILD_URL)
|
|
}
|
|
}
|
|
}
|