TeamCity cleaning out checkout directory even when clean files disabled

Hey all,

I'm having an issue with TeamCity, which relates to the fact that it is attempting to clear out the checkout directory, even though I have "Clean all files before build" unchecked. My project is a windows service, so there are complications with this, as when trying to delete the dll's it errors out since they're in use:

Error while applying patch: Failed to delete: F:\PathToService\bin\Release\Library.dll

The most frustrating part is that the dll's aren't even under source control, TeamCity seems to have a mind of its own and decides to try and delete them anyway. TeamCity does give me a few warnings under the checkout directory, so this may be related:

This directory might be cleaned by TeamCity before the build
The following build configurations have the same checkout directory but different VCS settings, this may lead to unnecessary clean checkout on agent:


I do have multiple projects that all have the same checkout directory, however they all use the same VCS root, just with different checkout rules. I do this because I want projects to only be triggered when affected files are changed, not every project building every time any file is checked in, and the projects use shared components.

Is there a way to get around this? I either need to be able to run a build step BEFORE doing the svn checkout so that I can stop the windows service first or need a way to stop it from trying to clear out the checkout directory.

Thanks,
Justin
4 comments
Comment actions Permalink

Well, the agent behavior is correct, since VCS settings are different (VCS roots + checkout rules) agent must clean files before starting new build. Moreover in the web UI you see warning that such situation is possible. So the question is: why do you need to specify your own checkout directory, why not leave the choice of the checkout directory to TeamCity?

0
Comment actions Permalink

I could try letting it choose the checkout directories, the one thing I'm worried about though is that there are some post-build msbuild tasks that copy dll's to certain folder locations, to be used by other projects. If TeamCity chooses the checkout directories then it will most likely create separate working directories for each project, so those dll's will never be copied over where they can be used by other projects. It certainly is nice to have one working directory that mirrors what you would have locally or what is in svn, are you telling me this isn't possible?

0
Comment actions Permalink

But you do not have the same working directory because you have different checkout rules. In other words your projects in fact require different working directories.

If you need to share some dlls of one build with other builds you can publish them as artifacts. Then in other builds you can setup artifact dependencies to download these artifacts on the agent before build starts, read more here: http://confluence.jetbrains.net/display/TCD6/Build+Artifact

0
Comment actions Permalink

Thanks, that worked. I'm not thrilled about having separate working directories for each project, it goes against how one would work locally and it duplicates shared library code, however I'm still happier with the end result than I ever was with CruiseControl.NET.

0

Please sign in to leave a comment.