These are chat archives for jenkinsci/jenkins

15th
Aug 2017
Nebojsa Videnov
@videnovnebojsa
Aug 15 2017 08:19
Hi, does anyone have a problem like this:
We are using pipelines to start builds in parallel, and we get randomly [build1] Failed in branch build1, failing after a while with java.lang.InterruptedException. The message is always related to the second build that is started in parallel. Any ideas?
Justin
@jgeorgeson
Aug 15 2017 12:44
@videnovnebojsa always the same parallel stream? if yes what's unique about that particular stream? etc
johny.zheng
@zsjohny
Aug 15 2017 12:46
How use same jenkinsfile repo for diff code repo ?
jinkinsfile.png
johny.zheng
@zsjohny
Aug 15 2017 13:02
@all
Alexey Shein
@conf
Aug 15 2017 13:19
@zsjohny You can't. Either copy-paste it in both repos, or use something like https://jenkins.io/doc/book/pipeline/shared-libraries/ for code re-use.
Justin
@jgeorgeson
Aug 15 2017 13:22
@zsjohny have two SCM checkouts in each build. Each checkout to a different subfolder (eg 'scripts' for Jenkinsfile and 'source' for the code). In the Script path put scripts/Jenkinsfile. In the Jenkinsfile you would need a dir() step to wrap all your actual steps so that they run in the 'source' working copy.
but in general I would recommend to use shared-libraries like @conf recommends, and keep your Jenkinsfile side-by-side with your code repo
johny.zheng
@zsjohny
Aug 15 2017 14:04
@jgeorgeson Could you show me by ci picture and jenkinsfile sample?
Justin
@jgeorgeson
Aug 15 2017 17:43
I'm afraid I don't have time to setup a mock job. If the Configure page for your job doesn't have settings to configure multipls SCM checkouts then you would need to look at maybe configuring a parameter(s) in your job for a second SCM details and then have a checkout step in your Jenkinsfile using that paramemter(s).