2
votes

I'm using TeamCity as a CI server and have a scenario with two Build Configurations. Build Configuration A generates artifact File A. Build Configuration B has an Artifact Dependency on A and builds from the same chain.

I need to configure a System Property (so it will be fed into MSBuild) on B that contains the full file path to File A. Is there a parameter reference I can use or other way to get it?

1

1 Answers

2
votes

In the artifact rules between Build B and Build A, you can specify a destination path relative to the build agent working directory to copy File A to. For example:

RelativePathTo/FileA => RelativePath

Then you can define a system parameter in Build B like

system.MsBuildProperty = %teamcity.build.checkoutDir%/RelativePath/FileA

which should give you the full path to the File A in Build B's checkout directory. This will be passed to MSBuild as normal. If you're after the full file path to File A in Build A's checkout directory from Build B then that's another story, as they could be running on a different agent.

Hopefully this will give you something workable, let us know how it goes.