Cruise control: should deployment be in tasks or publishers?
I'm setting up a Cruise Control configuration for one project. I have an <msbuild> task under <tasks>. It seems that I have the option of putting my file deployment under either <tasks> or <publishers>.
Logically I wo开发者_开发百科uld think it should reside under <publishers> but none of the examples I have seen online work this way.
Should deployment happen within in <tasks> or <publishers>?
It depends. Since CC.Net 1.5 tasks and publishers are quite the same, you can put your any task in the publishers section. The main difference is that, if a publisher fail, your project does not fail (at least it is not shown as failed in CCTray).
For "simple" deployment (for example, copying a dll to a server) I did it under the publishers because this deployment task does not impact the success of the build and it's not that much important if the deploy fails.
If the deployment is a important part of the build (website deployment for example), then I put it in the tasks section to be sure to be notified when it fails.
Deployment task should be in the tasks section.
As deployment part is playing with a final package, the build must succeed.
The publisher
section is executed whatever the build result is. If you want to deploy only if all tasks succeed, then write the deployment section as the last task of the tasks
section.
So if a task fails, the deployment will not occur.
EDIT: from ccnet documentation:
The
publishers
section is run after the build completes (whether it passes or fails). This is where you aggregate and publish the build results.
and
Historical Note Publishers and Tasks were different objects in earlier version of ccnet. Now they are interchangeable, and can appear either in the <prebuild> section, the <tasks> section, or the <publishers> section of the ccnet.config file depending on whether they should be run before, during or after the build.
reference : http://confluence.public.thoughtworks.org/display/CCNET/Task+And+Publisher+Blocks
精彩评论