How can I get a file that’s not under source control into a TeamCity build?

I'm new to TeamCity and want to use it to start using it as the CI solution for open-source project. So far, so good, but there's one problem I'm having. The unit tests for the project use an .xml file to get some user-specific configuration options (usernames & passwords amongst them)

Up until now, we've included an project file entry for setup.xml (the file in question) but omitted it from source control, the idea being that users get the source and want to run the tests provide their own version with their own usernames and passwords to run the tests as.

This is problematic for me now, as I want TeamCity to run the tests, obviously, but I'm at a loss as to how to provide it the appropriate version of the setup.xml file without adding it to SCC.
I've looked for a pre-build step option where I could use a script of some sort to add it in the appropriate location but don't see anything like that. I've also considered a second project that has that file as its output and is listed as a dependency of the main project, but that feels like overkill. (As is writing a plugin, something I've also considered and dismissed).
I'm hoping I'm overlooking an obvious solution due to my nubness.

2 comments
Comment actions Permalink

In TeamCity you can pass parameters (key/value pairs) to your build script.  You configure these parameters on one of the build config pages.  So for example if you are using msbuild then it is the equivalent of passing a property as a command line parameter.  Like "/c:TestUser=test_user" would create the msbuild property $(TestUser) and populate it with the value 'test_user'.  From there the script could either poke them into your setup.xml, or perhaps bypass setup.xml and pass them directly to whatever currently consumes setup.xml.

0
Comment actions Permalink

Wow, I totally blanked on getting MSBuild to do what I want and was looking for a way to do it with TeamCity itself.  Thanks, that was enough of a kick in the right direction.

0

Please sign in to leave a comment.