Update jenkinsfile after testing by edits live on jenkins

This commit is contained in:
Karl Palsson 2020-09-08 23:19:11 +00:00
parent 04dd4c6fc8
commit 52dc1ff6d7

View File

@ -7,29 +7,34 @@ pipeline {
}
stages {
// TODO - set build status to pneding....
stage('checkout') {
steps {
sh "echo karl we are building $pr_from_sha"
checkout([$class: 'GitSCM', branches: [[name: "$pr_from_sha"]], userRemoteConfigs: [[url: "$pr_from_git_url"]]])
step([$class: 'GitHubSetCommitStatusBuilder'])
//checkout([$class: 'GitSCM', branches: [[name: $pr_from_sha]], userRemoteConfigs: [[url: $pr_from_git_url]]])
git branch: "$pr_from_sha", url: "$pr_from_url"
}
}
stage('prepare') {
steps {
sh label: 'preparing python', script: '''
[ -f .env3 ] || python3 -m venv .env3
. .env3/bin/activate
pip install pyusb
pip install unittest-xml-reporting
'''
}
}
stage('build') {
steps {
sh 'make -j5 V=s'
sh 'make -C tests/gadget-zero all V=s'
sh '''
. .env3/bin/activate
make -j5 V=s
make -C tests/gadget-zero all V=s
'''
}
}
stage('Testprepare') {
steps {
sh label: 'preparing ', script: '''
[ -f .env3 ] || python3 -m venv .env3
. .env/bin/activate
pip install pyusb
pip install unittest-xml-reporting
'''
sh label: 'gadget0', script: '''
cd tests/gadget-zero
echo "hla_serial 53FF6E066765505136472567" > openocd.stm32f3-disco.local.cfg
@ -50,10 +55,11 @@ pipeline {
stage('run-test') {
steps {
sh '''
. .env/bin/activate
. .env3/bin/activate
cd tests/gadget-zero
rm -rf tests
python test_gadget0.py -X
for x in tests/*; do TT=$(basename $x); sed -i "s/testcase classname=\"/testcase classname=\"${TT}./g" $x/TEST-*; done
for x in tests/*; do TT=$(basename \$x); sed -i "s/testcase\\ classname=\\"/testcase\\ classname=\\"\${TT}./g" \$x/TEST-*; done
'''
}
}
@ -63,8 +69,8 @@ pipeline {
junit 'tests/gadget-zero/tests/*/TEST-*.xml'
step([
$class: "GitHubCommitStatusSetter",
commitShaSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/karlp/libopencm3"],
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/karlp/libopencm3"],
commitShaSource: [$class: "ManuallyEnteredShaSource", sha: "$pr_from_sha"],
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "$pr_from_git_url"],
contextSource: [$class: "DefaultCommitContextSource"],
statusResultSource: [ $class: "DefaultStatusResultSource"]
]);