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.