11
votes

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).

2

2 Answers

13
votes

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.

2
votes

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.