How would I know what trigger prompted the build ?

Hi All,

I started migrating from CC.NET to TeamCity and its been a great exp so far. TeamCity simply rocks. We are using MSBuild as build runner. I have a few questions and appreciate any help in this regard.
(1) How would I know what trigger prompted a build ? is it Manual, Nightly etc ? Does TC passes an property to MSBuild with this info ?(Something like $(CCNetRequestSource) in CC.NET).

(2) Is there a way to create an affinity between a build configuration and a build agent so that the build configuration always run on one specific build agent ? I am currently defining an env variable in Agent Requirements of the Build Configuration and I am making sure that only my build agent has this defined. It works but would like to know if TC server provides feature ?

TIA,
Ramesh

2 comments

1) Information about who triggered build is shown on the build results (with "Triggered by" label). As for build script there is no such property yet. The only way to provide it is to write custom plugin. There is related issue in our tracker: http://jetbrains.net/tracker/issue/TW-4502 please add comment with your use case here.

2) There is predefined agent.name property and you can create a requirement for it:
agent.name does not equal 'your agent name', or agent.name does not match (agent1|agent2)

--
Pavel Sher

0

Thanks for the response. It would definitely help for any build runner script to know what trigger started the build. Lets say if I want the build artifacts to be copied to a network share on every nightly build etc. I will add my comments to issue tracker.
For (2), this is really what I am looking for. Thanks a lot.

Ramesh

0

Please sign in to leave a comment.