Skip to main content
Version: QB13

Set up Builds for Multiple Branches

Situation

Set up multiple configurations to build multiple branches of a project. Common settings of these branch configurations such as SCM and step definitions should be shared to reduce build setup work and maintenance headache.

Resolution

Navigate to the demo project. It has three child configurations:

  1. Configuration 1.x builds against the 1.0 branch.
  2. Configuration 2.x builds against the 2.0 branch.
  3. Configuration 3.x builds against the 3.0 branch.

All these child configurations inherit repository and step definitions from the parent configuration. However the property Url to Checkout of repository definition in parent configuration is parameterized as below:

https://svn.pmease.com/demos/componentA/branches/${vars.get("branch")}

This tells QuickBuild to use value of variable branch to construct the url at checkout time. This variable is defined in each child configuration to reflect the real branch to build against. For example, for configuration 1.x, the branch variable is defined as 1.0 at variable setting of the configuration.

With this setup, common settings of these branches are maintained at the parent configuration, while different branch configurations can still build against different branches. Modifications of the common settings will affect all child branch configurations.