Update Jenkinsfile
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@@ -1,30 +1,23 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
|
environment {
|
||||||
|
JAVA_HOME = '/tool/jdk1.6.0_45'
|
||||||
|
ANT_HOME = '/tool/ant1.7.1'
|
||||||
|
}
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage('Compile'){
|
stage('Compile'){
|
||||||
steps {
|
steps {
|
||||||
|
sh "$ANT_HOME/bin/ant compile compile_tests"
|
||||||
sh "mkdir -p bin"
|
|
||||||
sh '''
|
|
||||||
CP=$(find /tool/junit4 -name "*.jar" | tr \'\\n\' \':\')
|
|
||||||
/tool/jdk1.6.0_45/bin/javac -target 1.5 -cp $CP -d bin \$(find ./src/* | grep .java)
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Test'){
|
stage('Test'){
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh "$ANT_HOME/bin/ant test"
|
||||||
CP=$(find /tool/junit4 -name "*.jar" | tr \'\\n\' \':\')
|
|
||||||
find bin/test -name "*.class" | sed \'s/bin\\///\' | sed \'s/\\.class//\' | tr \'/\' \'.\' | xargs -I {} java -cp ./bin:$CP org.junit.runner.JUnitCore {}
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Package'){
|
stage('Package'){
|
||||||
steps {
|
steps {
|
||||||
dir("bin")
|
sh "$ANT_HOME/bin/ant create_run_jar"
|
||||||
{
|
|
||||||
sh "/tool/jdk1.6.0_45/bin/jar cvfm ../CrossJeeves.jar ../manifest.txt ."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Archive Artifacts')
|
stage('Archive Artifacts')
|
||||||
|
|||||||
Reference in New Issue
Block a user