名前

SVN Flat Repository

バージョン

1.1

Product Versions

2.1 & 2.2.1

Author(s)

Radenko Kalajdzic

homepage

http://confluence.atlassian.com/display/BAMEXT/SVN+Flat+Repository

価格

Free

License

BSD

IssueTracking

http://developer.atlassian.com/jira/browse/BFLT

Subversion URL

http://svn.atlassian.com/svn/public/contrib/bamboo/bamboo-svnflat-repository-plugin/trunk or browse via fisheye

Download JAR

bamboo-svnflat-repository-1.0.jar (Bambo 2.1.x)

Download JAR

bamboo-svnflat-repository-1.1.jar (Bamboo 2.2.x)

Description/Feature

A plugin for Bamboo that provides support for SVN for flat project structure. More precisely, this plugin allows to specify a custom "extract source" command. For example, you can specify "mvn scm:checkout" command, an Ant script or what you want.

はじめに

Bamboo has out-of-the-box support for SVN repositories, but your project structure must be hierarchical. More specifically, you must point to a single SVN URL, which contains whole project hierarchy. But, if you have a large project with more complex structure, without having a single root SVN URL, this plugin is right for you.

インストール

Just copy bamboo-svnflat-repository-1.x.x.jar to "BAMBOO_HOME/webapp/WEB-INF/lib" directory of your bamboo installation and restart the Bamboo engine.

構成

In order to use the SVN-Flat plugin, you need to specify five parameters:

  • SVN user
  • SVN password
  • SVN base URL
  • A checkout command, which is able to extract your flat structure
  • An XML file, which contains SVN URLs of your flat project structure

SVN user/password

These parameters are user in order to connect to your SVN repository

SVN Base URL

This parameter is used to obtain the latest SVN release number from your repository.

Checkout command

You can specify any command line: a shell script, ant script, maven, etc... I am using a home-made maven plugin, which is able to extract a flat structure from SVN. The command line can reference standard Bamboo variables, as well as the following additionnal variables:

  • bamboo.svn.username
  • bamboo.svn.password
  • bamboo.svn.base.url
  • bamboo.svn.revision
  • bamboo.project.base.dir

例:

${bamboo.capability.mvn} project:extract-flat -Durl=scm:svn:${bamboo.svn.base.url}/dev/test/test-pom/trunk
  -Ddir=${bamboo.project.base.dir}
  -DextractRevision=${bamboo.svn.revision}
XML file that contains SVN URLs

You have to specify a location of an XML file, which must contain all SVN urls of your flat structure. It is used to collect the changes since the last build.

例:

${bamboo.project.base.dir}/project-info.xml

Here is an example of the content of this file:

<?xml version="1.0"?>
<projects>
  <project>
     <name>test-pom</name>
     <url>scm:svn:svn://svn.nespresso.com/dev/test/test-pom/trunk</url>
     <dir>C:\Appl\Bamboo\bamboo-home\xml-data\build-dir\TEST-DEF\test-pom</dir>
  </project>
  <project>
     <name>test-services</name>
     <url>scm:svn:svn://svn.nespresso.com/dev/test/test-services/trunk</url>
     <dir>C:\Appl\Bamboo\bamboo-home\xml-data\build-dir\TEST-DEF\test-services</dir>
  </project>
  <project>
     <name>test-web</name>
     <url>scm:svn:svn://svn.nespresso.com/dev/test/test-web/trunk</url>
     <dir>C:\Appl\Bamboo\bamboo-home\xml-data\build-dir\TEST-DEF\test-web</dir>
  </project>
  <project>
     <name>test-ear</name>
     <url>scm:svn:svn://svn.nespresso.com/dev/test/test-ear/trunk</url>
     <dir>C:\Appl\Bamboo\bamboo-home\xml-data\build-dir\TEST-DEF\test-ear</dir>
  </project>
</projects>

The plugin uses the following XPATH in order to obtain the URLs: "/projects/project/url"

Remark: You can generate this file within the command that is extracting your flat project structure or use a hand-written one. It is better to generate it during the extraction, because your flat-project structure might change.

制限事項

  • When collecting the changes, the plugin does not use SVN externals
  • All projects must be hosted within the same SVN base URL
  • The SVN password is not (yet) encrypted