سؤال

I'm trying to figure out how to run a pre/post command using the deploy.cmd generated by VS/MSBuild. I understand there are pre/postsync commands which can be set on the command line with msbuild but this is fixed within the web deploy package inside of the x.deploy.cmd.

How do I go about customizing the output of this file so that I can run the deploy command with specific parameters?

The intention is a non-developer will pick up the package zip file and import the application into IIS. We use IIS to host some windows services and so to be able to deploy we need to stop and uninstall the service before deployment and then install restart in the post deploy stage.

For certain servers we allow auto deployments from TFS and hook this pre/post command using the .targets file of the msbuild WPP pipeline. However, we want to this to be available to the manual deploy command files.

هل كانت مفيدة؟

المحلول

PreSync/PostSync are features of the msdeploy command line and are not supported by the package/manifest providers, or even the API. They are equivalent to running msdeploy a second time, so there's no way you'll be able to include their functionality while directly importing the package into IIS.

I'd recommend having a batch/powershell file on the server that the user runs after copying the package into the same directory.

نصائح أخرى

The .cmd file that MSBuild generates is boilerplate script that you can simply change to call your pre/post powershell scripts. Just overwrite the one generated by the build with your custom one.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top