[pipeline][checkout][@script] Checkout procedure

114 views
Skip to first unread message

jer...@bodycad.com

unread,
Aug 4, 2016, 2:32:31 PM8/4/16
to Jenkins Users
Hi,
I would like to have some information about the \workspace@script\ checkout for the scm. It look like Jenkins made a checkout into a temporary folder to extract the JenkinsFile. But the checkout is made for the JenkinsFile only? because after that the repository is empty. 

Do I have to make a second checkout into the workspace??? I was hoping to have the JenskinsFile to follow the source code to make sure it stay in sync.

We are ussing mercurial here, so I guess my best bet is to move the JenkinsFile into a sub repos of the main project?

Or can we use the workspace with @script as the workspace or check the JenkinsFile into the workspace directly without using the @script? 

I would like to avoid 2 checkout of the whole repos for each project and need to keep them into sync, they will change over time and I need to be able to build old source over a long period of time (10 years in fact), so I hope I won't have to sync 2 repos over time too much, I was really looking forward to have the JenskinsFile into the source repos and not having a subrepos for 1-2 files only.

Jerome

jer...@bodycad.com

unread,
Aug 4, 2016, 4:24:27 PM8/4/16
to Jenkins Users
After some thinking, the sub repos idea is a death trap, it just doesn't work, either way of sub repos, I still need a full checkout to get the proper JenkinsFiles, here's why:

Note: Mercurial Base SCM here

1. If JenkinsFile are inside a sub repos of my main repos:
  • To fetch the proper JenkinsFile I need to checkout the proper version of the main repos and have the sub repos to the right revision, this save me nothing
  • I cannot just checkout the head of the sub repos, since this may not be the right verison to build the main repos version
2. If main repos is sub repos of JenkinsFile:
  • I cannot parametrize my build and build different branch with different JenkinsFile, I need to know in advance the version of the sub repos which is exactly what I want to avoid by goin pipeline.
The only real option to make this work is to checkout the whole thing twice, once in @script and one in the normal workspace.
This is a real let down, since we have a huge repos with many external sub repos.

Maybe I'm missing something here but this feel like a weird features (maybe an option to disable that @script thing would be very welcom).

Jerome
Reply all
Reply to author
Forward
0 new messages