Hello,
we're beginning to use Jenkins' pipelines, and we especially like
the multibranch pipeline.
Currently our Jenkinsfile is minimal:
stage 'Build'
node {
catchError {
checkout scm
sh 'make clean test'
}
step([$class: 'Mailer', notifyEveryUnstableBuild: false,
recipients: '
a...@example.com', sendToIndividuals: true])
step([$class: 'JUnitResultArchiver', testResults: '*.xml'])
}
And works fine but for one detail: if somebody pushes anything to the
"helloworld" branch, and while Jenkins is building somebody else
pushes to the same branch,
if there're enough available executors then another job will be
started as soon as possible
with such new commit.
While a new, separate workspace is properly created on the fly, this
leads to an unnecessary
slowness of jobs (the setup phase for a brand-new workspace, performed
automatically in the
Makefile, is quite slow, much slower than the simple update or run
phase), so I'd like to serialize jobs for the same branch (parallelism
is fine as long as there're different branches).
How can I achieve that?
--
My homepage and blog:
www.franzoni.eu . @alanfranz on Twitter
contact me at public@[mysurname].eu