How to get artifacts out of team city by any non-manual means

I've googled and read the documentation.  No such luck in finding an explanation that makes any sense.

Here is my directory structure: Notice that both of these have dynamic paths, a guid an a version number, so I can't write a batch file to reference a static folder. (luntbuild used static output folders, which is a feature I miss)

C:\Documents and Settings\Administrator\.BuildServer\system\artifacts\Main Configuration\Apps Release\916\RELEASE\*.*

I have this setting for the build "Artifact Paths":

Web.csproj_deploy\Release\** => C:\Inetpub\wwwroot\Web.Release

The above setting appears to have no effect on the build's behavior.

I need to get my result copied to C:\Inetpub\wwwroot\Web.Release
(More to the point, I need to get my artifacts into an IIS virtual directory, which I can't do when the output folder changes its name on every build)

It takes 10 minutes for each build, so each experiment is taking a long time.  Because the "artifact paths" doesn't seem to care if it copies anything, the build succeeds despite the deployment of artifacts copying 0 files.  I kind of wish the build will fail with some useful error message when the artifact paths settings result in a no-op, no-copy.


Matthew Martin

Comment actions Permalink

TeamCity uses its own storage for the artifacts, inside the .BuildServer directory on the server. Artifacts are published using HTTP protocol, not just copied. Note that agents can be installed on any PC in the company network.

If you need to copy some files to different place, why not modify your build script to do this? Involving TeamCity in this process seems to be superfluous.

As for static checkout directory - you can set it in TeamCity too, see checkout directory field on the VCS settings page. Also it is worth reading TeamCity documentation on checkout directory:

Comment actions Permalink

Okay, if the artifacts storage isn't supposed to be access via the file system, that's fine, but even if I use something like curl to attempt to get the artifacts, the URL keeps changing.  I don't want to modify my post-build script each time to manually update the build number and URL to get the artifacts out of team city.

I'm not sure that the working directory is the best source for getting the artifacts because subsequent builds blow away the working folder.

I know that something exists to let MSBuild reference those %...% variables that team city emits, but I don't know which one has the URL, path to artifacts, etc.  I would assume that something like this exists.

If all else fails, I suppose I could implement a filesystem watcher and continuously scan the file system to find where artifacts appear, but that seems like a lot of effort.


Please sign in to leave a comment.