Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I specify the revision to checkout in a TeamCity build?

Tags:

svn

teamcity

Is there a way to specify which SVN revision to checkout in a TeamCity build?

If I attempt to change the SVN URL to include the revision using the @ notation, eg.

svn+ssh://svn/some/url@1234

then I get an error ("Unknown path kind").

I've searched all TeamCity documentation and can find nothing appropriate.

The background to this question is that I would like to run tests on a particular revision that for some reason was not done in the past (eg. the URL was not in TeamCity at the time).

like image 972
Graeme Moss Avatar asked Aug 02 '11 10:08

Graeme Moss


People also ask

What is VCS checkout?

VCS checkout rules allow you to check out a part of the configured VCS root and to map directories from the version control to subdirectories in the build checkout directory on a build agent.

What is checkout directory in TeamCity?

The build checkout directory is a directory on the TeamCity agent machine where all the sources of all builds are checked out into. If you use the agent-side checkout mode, the build agent checks out the sources into this directory before the build.


2 Answers

Yes, just hit the ellipses next to the "Run" button to trigger a custom build and choose the revision from the "Last change to include" list in the resultant screen. BUT - you can only choose from revisions which the build has previously run.

Unfortunately the only other option is to create a separate VCS root against a tag of the revision you want to run to do this. Not elegant, but it works.

like image 178
Troy Hunt Avatar answered Oct 20 '22 09:10

Troy Hunt


For git, there is this solution. I'm not sure how it will work for svn.

There is a way to have TeamCity list all branches in the 'custom build' dialog (the one you open by clicking the elipsis ... next to the Run button), including ones that haven't been built yet.

To show the branches, go to your VCS root, and set a branch specification. For git, it will be something like:

+:refs/heads/*

The star * here is a placeholder for what to show in the branches dropdown.

Note that this may cause your configurations to build on all branches automatically - so you may want to update the build triggers.

See the docs about feature branches for more.

like image 23
sinelaw Avatar answered Oct 20 '22 09:10

sinelaw