Control Release Candicate and Release Version

You are viewing an old version (v. 5) of this page.
The latest version is v. 7, last edited on Jan 06, 2010 (view differences | )
<< View previous version | view page history | view next version >>

Situation

Assumes we have:

  1. A release candicate configuration which is used to build release candicates of your software.
  2. A release configuration which is used to release your software.

Now we want to control build version of these two configurations so that:

  1. Version of builds in release candiciate configuration is composed of the release part and the candicate part, with the release part using the version to be released, and candiciate part increasing automatically for each build. For example, we are going to release 1.0, and candicate builds should use versions in form of: 1.0-rc1, 1.0-rc2, 1.0-rc3, ...
  2. When a release candicate build is promoted as release build, the release version should be automatically increased, and the candicate version should be reset to 1. For example, after 1.0 is released, new builds in release candicate configuration should use versions in form of: 1.1-rc1, 1.1-rc2, 1.1-rc3, ...

Demonstration

  1. Click here and press the run button to generate new release candicate builds. The rc part of the build version will be automatically increased.
  2. Click the promote button to promote a release candicate build as release build. A new release build will be generated in the release configuration.
  3. Return back to release candicate configuration and run it to generate a new build. The release part of the new build version will take value of next release number, and the rc part will reset to 1.

Resolution

  1. Define three variables in basic setting of project level configuration, respectively:
    • rc
      This variable is used control rc part of release candidate builds.
    • major
      This variable is used to control major part of the release version.
    • minor
      This variable is used to control minor part of the release version.
  2. Define next build version in basic setting of release candicate configuration like below:
    ${vars.get("major")}.${vars.get("minor")}-rc${vars.get("rc").increase()}

    This tells QuickBuild to use current value of variable major, minor, and rc to construct release candicate build version, and increase the rc variable by one after usage.

  3. Define next build version in basic setting of release configuration like below:
    ${vars.get("major")}.${vars.get("minor").increase()}

    This tells QuickBuild to use current value of variable major and minor to construct release build version.

  4. Configure a step in step graph of release configuration to execute below script:
    vars.get("rc").setValue(1)

    This script is executed by the master step in the demo site for simpliticy reasons, and it tells QuickBuild to reset rc variable to 1 when a new release is generated.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.