views:

22

answers:

2

I would like my MSbuild build script to be able to detect which server it is running on, if it is a local developers machine then run the targets that install the results on the local machine, if it is running on the build server then run the target that installs on the remote staging server.

What is the best strategy to achieve this?

We use TeamCity as our CI server.

+1  A: 

have you checked the ServiceController at MSBuild Community Tasks?

Paulo Santos
+2  A: 

What we do is have a server property we pass on the command line, dev for installing on the local machine, or the name of the server(s) to publish to if on the build server. This was the only way we could figure out.

Alex