I'm using Web Deploy to publish a web application from Visual Studio 2012 to my target IIS server. All fine there!
I now want to deploy to multiple servers in a web farm (within a workgroup). I have produced a Robocopy script to copy the files over the network to the other hosts once it has been deployed to the first web server. I can run this bat file manually no problem but I would like to automate it within the deployment process.
So far I've managed to edit the .pubxml
file in my VS project as follows.
<ItemGroup>
<MsDeploySourceManifest Include="runCommand">
<Path>robocopy "c:\web1" "\\REMOTEMACHINE\web1" /MIR</Path>
</MsDeploySourceManifest>
</ItemGroup>
This runs the command OK but before all files have been synchronised. Also according to the publish log it's running twice. In the middle of the file sync process.
How can I adapt the .pubxml
file to run that command only after all files are synchronised?