How to run task/program after sln2008 runner builds?

Hi,

Is there a way to run a program or a task after the sln2008 runner completes a build (or fails)?  I'm running TeamCity 4.5.  I do not want the task to be run on development machines, but rather only run on the CI server.  For example, I would like to have the CI machine monitor source control for changes.  When it detects a change, build the project and run the unit tests.  If that succeeds, then execute a program (or task, script, or whatever) to copy those files to a review/stage server.

Any help is appreciated

Thanks

Jim

1 comment
Comment actions Permalink

Hi Jim,

The easy way would probably be to add a post build event to the appropriate project (whichever project builds last).  In that event do the copy, but only after confirming you are on the server (check some system var or for Release configuration, whatever).

The better way, IMO, would be to drive your CI build with an msbuild script.  It could be a simple two liner, first pass your solution file to the <msbuild/> task, then call the the <copy/> task.  Getting started with a build script in a solid build language (like msbuild, or nant if you prefer) will pay back dividends as you grow your build in the future.

Josh

0

Please sign in to leave a comment.