klayout/Jenkinsfile

70 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-06-23 09:45:06 +02:00
2018-06-24 10:11:46 +02:00
@Library("osconfig") _
2018-06-24 10:36:19 +02:00
// from shared library
target = osconfig()
2018-06-24 10:15:35 +02:00
2018-06-24 11:45:15 +02:00
currentBuild.description = "Pipelined " + target
2018-06-23 09:45:06 +02:00
node("master") {
2018-06-24 10:45:08 +02:00
artefacts = pwd() + "/artefacts"
target_dir = artefacts + "/" + target
2018-06-23 09:45:06 +02:00
2018-06-24 10:45:08 +02:00
stage("Checkout sources") {
checkout scm
}
stage("Building target ${target}") {
2018-06-23 09:45:06 +02:00
withDockerContainer(image: "jenkins-${target}") {
2018-06-24 11:45:15 +02:00
// from shared library
build(target, target_dir)
2018-06-23 09:45:06 +02:00
}
2018-06-24 10:45:08 +02:00
}
2018-06-23 09:45:06 +02:00
2018-06-24 10:45:08 +02:00
stage("Publish and test") {
2018-06-23 09:45:06 +02:00
parallel(
2018-06-24 10:36:19 +02:00
"Publish": {
// from shared library
2018-06-24 10:45:08 +02:00
publish(BRANCH_NAME, target, target_dir)
2018-06-24 10:36:19 +02:00
},
2018-06-23 09:45:06 +02:00
"Unit testing": {
rel_work_dir = target + "/BUILD/build.linux-release"
work_dir = pwd() + "/" + rel_work_dir
2018-06-24 11:45:15 +02:00
2018-06-24 10:45:08 +02:00
withDockerContainer(image: "jenkins-${target}") {
2018-06-23 09:45:06 +02:00
2018-06-24 10:45:08 +02:00
sh """
2018-06-24 11:45:15 +02:00
cd ${work_dir}
2018-06-23 09:45:06 +02:00
set +e
LD_LIBRARY_PATH=. TESTSRC=../../.. TESTTMP=testtmp xvfb-run ./ut_runner -c -a | tee ut_runner.xml
set -e
"""
2018-06-24 10:45:08 +02:00
}
2018-06-23 09:45:06 +02:00
junit(testResults: "${rel_work_dir}/ut_runner.xml")
2018-06-23 09:45:06 +02:00
},
"Installtest": {
2018-06-24 10:45:08 +02:00
withDockerContainer(image: "jenkins-${target}-basic") {
2018-06-24 11:45:15 +02:00
// from shared library
installtest(target, target_dir)
2018-06-24 10:45:08 +02:00
}
2018-06-23 09:45:06 +02:00
})
2018-06-24 10:45:08 +02:00
}
2018-06-23 09:45:06 +02:00
}