Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN externals and automated build

I have a project that uses SVN externals to include some stuff (actually it's the MSBuild Community Tasks, but that's tangential). The external repository requires a username 'guest' but no password.

I've set an externals property and this works perfectly when doing an SVN Update locally. The problem comes when my TeamCity continuous integration build runs. TeamCity tries to checkout the sources and chokes on the externals, because it doesn't know the username.

I've tried defining the externals as a separate SVN root in TeamCity, but that doesn't work so I don't think it is the solution.

So how do I make this work? How do I let TeamCity know that it needs to log in to the external SVN repo?

like image 680
Tim Long Avatar asked Jan 23 '23 08:01

Tim Long


2 Answers

If no password is required, only a username then you can easily set this up in the servers config file (on Windows, it's located in %APPDATA%\Subversion\servers).

Specify the server and then set the 'username' option. For example:

[groups]
communitytasks = *.comunityserver.com

[communitytasks]
username = guest
like image 96
Stefan Avatar answered Jan 25 '23 20:01

Stefan


Authentication information is stored in a configuration file local to the user running the program. Or at least, it can be configured to do that.

I bet TeamCity's Agent program runs under a different user than the one you log into the machine with. If it does, you should try just logging into the machine with the same user, then do a svn checkout to a temporary directory and fill in the username and password. This will be cached, and thus when TeamCity runs SVN under the same user, it should reuse that information.

like image 39
Lasse V. Karlsen Avatar answered Jan 25 '23 22:01

Lasse V. Karlsen