3
votes

I'm currently in the process of configuring StatSVN to run in TeamCity and am running into a bit of a problem I need some ideas on. Firstly, StatSVN needs to run against a working directory that has been checked out from SVN, it can't run against the copy of the app that TeamCity exports from SVN. As such, it needs to perform an svn checkout on the build server.

What I've done is created a bat file which runs the three command required by StatSVN to create the report, the first of which is the checkout:

svn checkout [repository path]

Now, correct me if I'm wrong, but this should checkout using the current identity. Certainly it runs fine directly from the command line. When it runs in TeamCity, the build runner is configured to run under a service accout which has identical rights to me in SVN. In fact the same service account is used to create repositories and default directory structures so I've no doubt it has the rights.

However, every time the build runs it hangs and after stopping it, it's obvious why:

[13:38:28]: C:\TeamCity\buildAgent\work\e8d4dc4070ecf602>svn checkout [repository path] 
[13:38:29]: Authentication realm: <[svn server]> Subversion Repositories
[13:38:38]: Password for '[service account]': 
[13:38:38]: Process exited with code 1

It appears to be hanging and waiting for a password which it obviously can't get whilst running unattended. Does anyone have any ideas on why this is happening?

Update: The next command required by StatSVN is an "svn log" which dumps the commit history. Even if you can tackle the issue of svn checkout by configuring the TeamCity VCS checkout mode to "Automatically on agent" hence resulting in an actual checkout rather than an export (this is certainly preferable to a manual command), the "svn log" command still presents the same problem.

3

3 Answers

4
votes

You can at least stop it from asking for input by using

svn checkout --non-interactive

This will not solve the problem that it doesn't know the user, but might give you more information about what's wrong

2
votes

would it be possible to solve this by changing the checkout on teamcity from being "server side"(export) to be client side (checkout)..? then you would actually get all your svn folders.

you can then exclude them from your build (nant or msbuild) so that they never make it into your built project folder.

i know this doesn't answer your question directly, but it may solve your actual problem.

1
votes

Probably too late to help the OP but I experienced a similar problem to this when performing checkouts. svn would continually prompt for a username and password despite them being supplied using the --username and --password switches. When the --non-interactive switch was added (as per Sander Rijken's suggestion) svn responded that the password was incorrect. In actual fact, the password was correct but contained characters that weren't being correctly escaped.