5.1 Working with Subversion

You are viewing an old version (v. 21) of this page.
The latest version is v. 35, last edited on Sep 29, 2009 (view differences | )
<< View previous version | view page history | view next version >>

Define subversion repository

Subversion repository can be defined by choosing the subversion menu item from the repository menu as below:

Unable to render embedded object: File (subversion1.png) not found.

If you can not find the subversion menu item, it is most probable that subversion plugin has not been configured at plugin management page.
All text properties of subversion repository can be defined as dynamic string.

Handle https and svn+ssh schema

To connect to subversion repository with https and svn+ssh schema, you'll need to permanently accept the subversion sever certificate from command line before running QuickBuild. The detailed step is:

  1. login to the build machine as the user which will be used to launch QuickBuild process
  2. connect to your subversion repository using subversion command line, and if the server asks for whether or not to save credentials for subsequent usages, choose "yes"
  3. make sure subsequent subversion commands does not prompt for user name and password
  4. start QuickBuild process

Checkout from multiple urls

QuickBuild 2.0 removes module definition for subversion repository for the reason of keep simple things simple, complex things possible. In most cases, checking out from a single url is sufficient. However, checking out from multiple urls is still possible, you just need to define multiple subversion repositories pointing to desired url and add corresponding checkout steps to checkout them.

Things get a bit complex if these urls are pointing to the same subversion SCM repository, and you want to make sure that these checkouts are performed against the same repository revision. To do this:

  1. Define a top level subversion repository covering all urls you want to checkout, assume the name is top, the destination path property of this repository is not important as it will not be used for actual checkout
  2. For each child repository (the repository responsible for checking out desired url), define the revision to checkout as below:
    ${getConfiguration().getRepository("top").revision}
    
  3. Add a take snapshot step to take snapshot of the top repository, and add checkout steps to checkout from each child repository. Arrange them into a sequential step, and make sure the take snapshot steps comes before other checkout steps.

External support

If ignore externals option is not checked, QuickBuild will checkout specified url together with any external definitions. However, it does not detect changes for external urls, that is, the isChanged() method for the repository does not return true even if there are new checkins made into the externals. There are two approaches to get around this:

  1. If you only want to detect changes from externals, and trigger the build if externals are changed.
    1. Keep ignore externals as unchecked for the subversion repository
    2. For each external url, define a corresponding subversion repository in QuickBuild, the destination path property is not important as these repositories will only be used for changing detection. No any checkout will be done for these repositories.
    3. Modify the build necessary condition to detect changes from these repositories. For example, if the main subversion repository is defined as repository1, and it has two externals, respectively defined as external1 and external2, the build necessary condition can be defined as:
      getRepository("repository1").isChanged() || getRepository("external1").isChanged() || getRepository("external2").isChanged()
      

      This approach has a limitation: although it can detect changes from externals and trigger the build, the external changeset does not appear in the [build changes] tab. The next approach addresses this.

  2. If you want to detect changes from externals, and trigger the build if externals are changed. Besides this, you also want change set of externals appear in the [*build changes*] tab together with the main repository
    1. Check the option ignore externals for the main subversion repository. That is, the main subversion repository will no longer responsible for external checkouts
    2. For each external url, define a corresponding subversion repository, and add steps to checkout these repositories together with the main repository. The destination path property for these external repositories should be well defined, so that the final checkout directory structure looks the same with the directory structure when externals are enabled to checkout.
    3. Modify the build necessary condition to detect changes from these repositories. For example, if the main subversion repository is defined as repository1, and it has two externals, respectively defined as external1 and external2, the build necessary condition can be defined as:
      getRepository("repository1").isChanged() || getRepository("external1").isChanged() || getRepository("external2").isChanged()
      

Proof build support

For general concept of proof build, refer to [proof build]. Here we explains how to set up subversion repository to support proof build. Below are necessary steps:

  1. Edit the subversion plugin setting and set the property subversion executable path to a dynamic string like below:
    ${node.getAttribute("svnPath")}
    

    This tells QuickBuild to use value of the attribute "svnPath" defined at each grid node (including user agent) as subversion may installed at different location for different node. Developers should define this user attribute at their agent tab to reflect their subversion installation.

  2. Edit the subversion repository, and set the working copies property to a dynamic string like below:
    ${node.getAttribute("svnWorkingCopies")}
    

    This tells QuickBuild to use value of attribute "svnWorkingCopies" defined at each user agent when collect uncommitted changes as the working copy paths of different user may be different. Developers should define this user attribute at their agent tab according to their development environment. A sample screen to define this attribute is like below:
    Unable to render embedded object: File (workingcopies.png) not found.
    More than one working copy directories can be specified as value of the attribute as long as they are not overlapped. The user agent will collect user's local change (uncommited change) recursively in the working copy directories and send to QuickBuild server to patch the content checked out by the subversion repository at the time of running the build.

  3. If your team use user name/password to access subversion, you will need to define user name of the subversion repository like below for the repository:
    ${node.getAttribute("svnUser")}
    

    This tells QuickBuild to use value of attribute "svnUser" defined at each grid node (including user agent) as the account used to access Subversion may be different for different node. Developers should define this attribute at their agent tab according to reflect their subversion accounts.
    In this case the password property should also use dynamic string just like the user property.

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