[build-flow] Make sure all jobs use the same revision

30 views
Skip to first unread message

nfwlpw

unread,
Apr 14, 2015, 4:00:54 PM4/14/15
to jenkins...@googlegroups.com
We have a single SVN repo broken up into sub projects, Proj1 must be built first, followed by Proj2.  The problem is Proj1 takes a few hours so during which time someone could've checked something into Proj2, so I want to make sure Proj2 uses the revision used by Proj1.  I've been thinking how to tackle this.

Option 1: give the build flow a REVISION parameter and pass that to all the jobs, but then you have to enter it each time (obviously I can't set it as HEAD since that is what I want to avoid).  Proj1 needs to return the revision and Proj2 needs to read it

Option 2: timestamp.  Somehow the build flow get the timestamp and pass it to all the jobs.  However I have to massage it into a format SVN can accept.  Is it possible with the DSL?

Option 3: Have an Init job before build flow, and let it figure out what the SVN revision is, then call build flow with that revision.

Anyone done something similar?

Les Mikesell

unread,
Apr 14, 2015, 4:32:11 PM4/14/15
to jenkinsci-users
Assuming you really mean build_flow and not workflow, you can make
proj2 a parameterized job to pass REVISION like:

b1=build("Proj1")
b2=build("Proj2",REVISION: b1.build.properties.envVars["SVN_REVISION"] )

--
Les Mikesell
lesmi...@gmail.com
Reply all
Reply to author
Forward
0 new messages