Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure TeamCity to build from SVN trunk, branches and/or tags

How can I configure TeamCity to build from SVN trunk and also from different branches and/or tags ?

Our idea is to have multiple builds from the same project, this way we can have the current version that is in production (with the ability to make deploys and fixes over that "release tag") and at the same time have the trunk and branches with the actual development that is taking place daily.

We have our policies, owner and all that for our SVN directories, the problem that we have is how to configure TeamCity to make multiple builds for the same project over the different "versions" or "states" of the application.

What is the best way to do this ?

Thanks in advance !

like image 485
a4bike Avatar asked Jul 29 '11 14:07

a4bike


People also ask

What is SVN trunk branch and tag?

There is no difference between branches and tags in Subversion. The only difference is in what the user then does with the directory. Branches are typically created, edited, and then merged back into the trunk. Alternatively, tags are created as a snapshot of the project at a point in time and then never changed.

What is the difference between trunk and branch in SVN?

A trunk in SVN is main development area, where major development happens. A branch in SVN is sub development area where parallel development on different functionalities happens. After completion of a functionality, a branch is usually merged back into trunk.

How do I create a SVN trunk?

Go into the root folder of your working copy and run svn switch REPO_URL/trunk --ignore-ancestry . It should say At revision X where X is the revision after you moved all of your files from the root directory into the trunk directory. That's it!


2 Answers

First, ensure your VCS root is the root of your SVN repository in your administration panel, instead of being pointed to the trunk directory.

Then, for each build configuration, edit the checkout rules in your VCS Configuration. Add the checkout rule you desire.

For example, for your 'trunk' build configuraton, you would have a checkout rule of: +:trunk => ..

If you have a tag or branch you want to build, just create a new build config with a corresponding checkout rule. A tag of 'release-1.1' would have a checkout rule of: +:tags/release-1.1 => .

Here is the documentation on checkout rules: http://confluence.jetbrains.net/display/TCD65/VCS+Checkout+Rules

like image 195
codeprogression Avatar answered Oct 17 '22 17:10

codeprogression


I had similar problem with SVN in TeamCity and to allow work with multiple branches I used Configuration parameter to pass "branch" since TeamCity doesn't support multibranch for SVN. enter image description here

And set trigger to start build from that branch: enter image description here

So in project it looks like: enter image description here

like image 2
Tamara Koliada Avatar answered Oct 17 '22 17:10

Tamara Koliada