Subversion - General Information
This appendix provides general information on the connection and definition of the Subversion Repository, including some concrete examples and a section on Meta Properties.
Repository Connection
Kobee connects with the repository using the SVN client which must be installed on the IKAN ALM Server machine. The Command Path refers to the path where this SVN client is located.
A Subversion Repository is identified via its Repository URL, e.g., file:///path/to/repos or svn://servername or http://my.domain/repos. For more information, see the on-line book about Subversion "Version Control with Subversion, Chapter 2 - Basic Concepts" at http://svnbook.red-bean.com/en/1.7/svn.basic.version-control-basics.html. In chapter 7 of this book you will find a table about repository URLs and a topic about the Subversion Repository.
In most cases a User ID and Password must be provided, unless the repository is not protected (e.g., for the svn protocol, anon-access = write in the svnserver.con file
) or unless the credentials of the user running the Kobee web server or application server process are stored in this user’s private runtime config area (~/.subversion/auth/ or %APPDATA%/Subversion/Auth/). See also http://svnbook.red-bean.com/en/1.7/svn.serverconfig.netmodel.html#svn.serverconfig.netmodel.credcache.
Repository Definition
Specific fields in the Subversion definition are necessary to support the flexible setup of a Subversion Repository Layout (see http://svnbook.red-bean.com/en/1.2/svn.reposadmin.projects.html#svn.reposadmin.projects.chooselayout).
This sections provides the following information:
Specific Fields
The following specific fields have been added to the Subversion definition:
-
Trunk Directory
-
Tags Directory
-
Repository Layout
Trunk Directory
The Trunk Directory is the directory of the “head” or “main” development stream. Its default name is trunk, but other names are allowed, e.g., main, head.
This directory may reside directly under the repository path, or be defined per project, depending on the settings of the Repository Layout field described here below.
The Trunk field may have an empty value only if the Repository Layout field has the "Repository-oriented" value. In the case of a Project-oriented or Single Project-oriented Repository Layout, the Trunk directory must be specified to avoid infinite continuous builds if a schedule is set on such a repository definition (because the Tags directory would be part of the trunk, tagging would mean changing the trunk, and you would get an infinite loop). |
Tags Directory
The Tags Directory is the directory where Kobee creates the tags (also called labels) after a successful build. Its default name is tags, but other names are allowed, e.g., tag.
This directory may reside directly under the repository path, or be defined per project, depending on the settings of the Repository Layout field.
Repository Layout
The default Repository Layout is "Project-oriented". Other possible values are: "Repository-oriented" and "Single Project-oriented".
See the Layout Examples for the configuration of the 4 possible Layouts.
Layout Examples
This section provides some possible repository project layouts followed by the possible solution in Kobee for a Subversion Repository.
The directory names used (trunk, tags, branches) are fully arbitrary. If you decided to call the trunk "main" or "head", or the branches "stream" or ., you are free to do so. |
Layout 1 (Project-oriented)
Structure in the Subversion Repository:
/ /calc /calc/trunk /calc/branches /calc/tags /paint /paint/trunk /paint/branches /paint/tags |
Definition in Kobee:
URL = Repository URL defined in the Subversion definition. |
Description | Value | |
---|---|---|
Trunk Directory (Subversion Repository) |
The Trunk Directory for the Subversion Repository. |
trunk |
Tags Directory (Subversion Repository) |
The Tag Directory for the Subversion Repository. |
tags |
Repository Layout (Subversion Repository) |
One of the 3 possible Repository Layouts. |
Project-oriented |
VCR Project Name (Project Definition) |
The name of the Project as known within the VCR. |
calc |
Validate Project (Project Definition) |
When clicking “Check Project Name in the VCR” the existence of these directories is checked. |
URL/calc/trunk URL/calc/tags |
Check-out Main (Level Request Handling) |
Directory checked out from the head stream of the project in the “Retrieve Code” Phase. |
URL/calc/trunk |
Tag Sample Main (Level Request Detail) |
Sample of a tag after a successful build in the head stream. |
URL/calc/tags/H_1-0_b1 |
VCR Branch ID (Branch Project Stream Definition) |
The Branch ID defined within the VCR. |
/calc/branches/B_1-2 |
Validate Branch (Branch Project Stream Definition) |
When clicking “Check Branch ID in the VCR” the existence of these directories is checked. |
URL/calc/branches/B_1-2 |
Check-out Branch (Level Request Handling) |
Directory checked out from the Branch of the project in the “Retrieve Code” Phase. |
URL/calc/branches/B_1-2 |
Tag Sample Branch (Level Request Detail) |
Sample of a tag after a successful build in a branch stream. |
URL/calc/tags/B_1-2_b5 |
Layout 2 (Repository-oriented)
Structure in the Subversion Repository:
/ /trunk /trunk/calc /trunk/paint /tags/paint /tags/calc /branches |
Definition in Kobee:
URL = Repository URL defined in the Subversion definition. |
Description | Value | |
---|---|---|
Trunk Directory (Subversion Repository) |
The Trunk Directory for the Subversion Repository. |
trunk |
Tags Directory (Subversion Repository) |
The Tag Directory for the Subversion Repository. |
tags |
Repository Layout (Subversion Repository) |
One of the 3 possible Repository Layouts. |
Repository-oriented |
VCR Project Name (Project Definition) |
The name of the Project as known within the VCR. |
calc |
Validate Project (Project Definition) |
When clicking “Check Project Name in the VCR” the existence of these directories is checked. |
URL/trunk/calc URL/tags/calc |
Check-out Main (Level Request Handling) |
Directory checked out from the head stream of the project in the “Retrieve Code” Phase. |
URL/trunk/calc |
Tag Sample Main (Level Request Detail) |
Sample of a tag after a successful build in the head stream. |
URL /tags/calc/H_1-0_b1 |
VCR Branch ID (Branch Project Stream Definition) |
The Branch ID defined within the VCR. |
/branches/calc/B_1-2 |
Validate Branch (Branch Project Stream Definition) |
When clicking “Check Branch ID in the VCR” the existence of these directories is checked. |
URL/branches/calc/B_1-2 |
Check-out Branch (Level Request Handling) |
Directory checked out from the Branch of the project in the “Retrieve Code” Phase. |
URL/branches/calc/B_1-2 |
Tag Sample Branch (Level Request Detail) |
Sample of a tag after a successful build in a branch stream. |
URL /tags/calc/B_1-2_b5 |
Layout 3 (One Repository = One Project)
Structure in the Subversion Repository:
/ /trunk /tags /branches |
Definition in Kobee:
URL = Repository URL defined in the Subversion definition. |
Description | Value | |
---|---|---|
Trunk Directory (Subversion Repository) |
The Trunk Directory for the Subversion Repository. |
trunk |
Tags Directory (Subversion Repository) |
The Tag Directory for the Subversion Repository. |
tags |
Repository Layout (Subversion Repository) |
One of the 3 possible Repository Layouts. |
Single Project-oriented |
VCR Project Name (Project Definition) |
The name of the Project as known within the VCR. |
Empty |
Validate Project (Project Definition) |
When clicking “Check Project Name in the VCR” the existence of these directories is checked. |
URL/trunk URL/tags |
Check-out Main (Level Request Handling) |
Directory checked out from the head stream of the project in the “Retrieve Code” Phase. |
URL/trunk |
Tag Sample Main (Level Request Detail) |
Sample of a tag after a successful build in the head stream. |
URL /tags/H_1-0_b1 |
VCR Branch ID (Branch Project Stream Definition) |
The Branch ID defined within the VCR. |
/branches/B1-2 |
Validate Branch (Branch Project Stream Definition) |
When clicking “Check Branch ID in the VCR” the existence of these directories is checked. |
URL/branches/B1-2 |
Check-out Branch (Level Request Handling) |
Directory checked out from the Branch of the project in the “Retrieve Code” Phase. |
URL/branches/B1-2 |
Tag Sample Branch (Level Request Detail) |
Sample of a tag after a successful build in a branch stream. |
URL /tags/B_1-2_b5 |
Layout 4 (Repository-oriented, no trunk)
Structure in the Subversion Repository:
/ /calc (= trunk directory) /paint (= trunk directory) /tags/paint /tags/calc /branches |
Definition in Kobee:
URL = Repository URL defined in the Subversion definition. |
Description | Value | |
---|---|---|
Trunk Directory (Subversion Repository) |
The Trunk Directory for the Subversion Repository. |
Empty |
Tags Directory (Subversion Repository) |
The Tag Directory for the Subversion Repository. |
tags |
Repository Layout (Subversion Repository) |
One of the 3 possible Repository Layouts. |
Repository-oriented |
VCR Project Name (Project Definition) |
The name of the Project as known within the VCR. |
calc |
Validate Project (Project Definition) |
When clicking “Check Project Name in the VCR” the existence of these directories is checked. |
URL/calc URL/tags/calc |
Check-out Main (Level Request Handling) |
Directory checked out from the head stream of the project in the “Retrieve Code” Phase. |
URL/calc |
Tag Sample Main (Level Request Detail) |
Sample of a tag after a successful build in the head stream. |
URL /tags/calc/H_1-0_b1 |
VCR Branch ID (Branch Project Stream Definition) |
The Branch ID defined within the VCR. |
/branches/calc/B_1-2 |
Validate Branch (Branch Project Stream Definition) |
When clicking “Check Branch ID in the VCR” the existence of these directories is checked. |
URL/branches/calc/B_1-2 |
Check-out Branch (Level Request Handling) |
Directory checked out from the Branch of the project in the “Retrieve Code” Phase. |
URL/branches/B1-2 |
Tag Sample Branch (Level Request Detail) |
Sample of a tag after a successful build in a branch stream. |
URL /tags/calc/B_1-2_b5 |
Fetching Meta Properties
Subversion provides interfaces for adding, modifying, and removing versioned metadata on versioned directories and files. Those metadata are referred to as properties, see the "Version Control with Subversion, Chapter 7 - Advanced Properties" book at http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html, which explains how to use and set these properties on files and directories.
Kobee makes it possible to use those properties during the build and deploy processes. If the "Fetch Meta Properties" value is set to yes, the following will happen during the build process:
-
Creation of a properties file (vcr.properties)
At the end of the "Retrieve Code" Phase during the handling of a Level Request a properties file
vcr.properties
will be created in the root directory of the checked out code. This file will contain all meta properties of the files in the checked out URL (trunk or branch) in the following form:path.to.file.filename.propertyname=propertyvalue
If a file has multiple properties linked to it, this will of course result in multiple entries in the
vcr.properties
file.Some samples
Sample 1: A property with property name register and property value true on the file /bin/Musicbiz.dll will result in the following propertyline:
bin.Musicbiz.dll.register= true
Sample 2: The file /MusicLib/WEB-INF/web.xml has two properties linked to it: servletspecs=2.5 and unchangeable=true. This will result in following property lines in the
vcr.properties
file:MusicLib.WEB-INF.web.xml.servletspecs= 2.5
MusicLib.WEB-INF.web.xml.unchangeable= true
-
Transportation of the vcr.properties file to the Source Directory of the Build Environment
During the "Transport Source" Phase of a Build process the
vcr.properties
file will be transported to the source directory of the Build Environment together with the sources checked out from your Subversion trunk or branch directory.In order to use the properties, the build script should be adapted, e.g., when using an ANT scripting tool, the properties may be imported in the script via a <property file="vcr.properties"/> task.
-
Inclusion of the vcr.properties file in the Build result
When these properties should also be available during a following deploy process(es), i.e., on a deploy environment that is linked to this build environment, the
vcr.properties
file should be included in the Build result.This can be achieved by including a copy instruction in the build script which copies the
vcr.properties
file from the source (predefined build parameter source) to the target (predefined build parameter target) directory of the Build Environment.In that way the
vcr.properties
file will be included in the build result, and as a consequence it will be available to be used in the deploy script during a deploy action of this build result.