Build Configurations

I want to have a CheckoutTrunk and a CheckoutBranch build configuration inside a single project.

When the build configuration called CheckOutTrunk runs I want to have a snapshot dependency called Compile which will compile the code build within CheckOutTrunk.
When the build configuration called CheckOutBranch runs I want to use a snapshot dependency called Compile which will compile the code build within CheckOutBranch.

When I am within the Compile Build Configuration I have to supply a checkout rule - Id like to be able to set this via a parameter, but it needs to be the one parameter so that I can either point it to the CheckOutTrunk or the CheckOutBranch code.

Is this possible - can I somehow get the branch which was build and pass this as a parameter to the checkout rule for the Compile build configuration?

Thanks
Gregor

5 comments
Comment actions Permalink

Hi Gregor,

If Complie build configuration snapshot depends on both Trunk and Branch build configurations then: if you run Compile build configuration both Trunk and Branch will be triggered. I would recommend to create two different build configurations CompileTrunk snapshot depends on Trunk and CompileBranch on Branch. You can use templates to simplify the setup.

0
Comment actions Permalink

Hi Alina

Little bit more involved than that - not sure its possible but I shall try and explain a bit better.

If I have the following build steps

Checkout (pointing to trunk as a checkout rule)
Compile (pointing to trunk as a checkout rule)
Inspections (pointing to trunk as a checkout rule)
UnitTests (pointing to trunk as a checkout rule)
Package (pointing to trunk as a checkout rule)

Id like to be able to run the Checkout Task against a checkout out rule of say trunk, and then once the checkout is built, the compile build step is called and so on in that order.

What I dont want to have to do is for each build step, have to attach a VCS root, that way I cannot just change the VCS root for the Checkout build step to say something like branches/release/todaysdate/ and have it check that source out and then go on and do all of my build steps.

So in essence I dont want to have to have this as well:-

Checkout (pointing to branches/release/todaysdate/ as a checkout rule)
Compile (pointing to branches/release/todaysdate/ as a checkout rule)
Inspections (pointing to branches/release/todaysdate/ as a checkout rule)
UnitTests (pointing to branches/release/todaysdate/ as a checkout rule)
Package (pointing to branches/release/todaysdate/ as a checkout rule)

0
Comment actions Permalink

Gregor, feature branch is not supported for Subversion (how it is done for DVCS: Git/Mercurial). Please watch and vote for the related feature request.
The recommended approach is to create different build configurations for different branches. In this case you will be able to configure triggers and build history will be understandable.
You can create single shared VCS root and create a template with this VCS root attached and checkout rules, like %checkout.rules%.

Then in each configuration inherited from this template which works with specific branch you can define custom value for checkout rules, like: +:branch1=>.

0
Comment actions Permalink

I am trying to do as you suggested but struggling with it - can you show me some screenshots of how to go about this?

Thanks
Gregor

0
Comment actions Permalink

You can create template with attached VCS root, where configuration parameter %svn.branch% is used in URL. For example:
Screen Shot 2015-03-06 at 16.22.06.png
Create build configuration base on this template and define %svn.branch% parameter:
Screen Shot 2015-03-06 at 16.23.40.png
Or intsead of using paramter in VCS root URL, you can use it in checkout rules:
Screen Shot 2015-03-06 at 16.33.37.png

0

Please sign in to leave a comment.