1

I have a project which I can deploy to 4 sites from within VS2010, 2 using file based deployment and 2 using web deploy.

Its boring to sit through waiting for the deploys one after the other so I'd like to automate this. On the command line.

I know about msdeploy, but I can't see how to either tell it the same options which are in .Publish.xml or get it to use the settings which are saved there.

What I'd like is a batch file which looks something like

msbuild Project.sln /p:Configuration=Config1
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server1DeploySettings"
msbuild Project.sln /p:Configuration=Config2
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server2DeploySettings"
msbuild Project.sln /p:Configuration=Config3
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server3DeploySettings"
msbuild Project.sln /p:Configuration=Config4
magicDeployingProgram Project.sln /p:PublishXMLConfigurationName="Server4DeploySettings"

Or equivalent. I don't mind re-specifying the settings to msdeploy, but when I tried this I couldn't find the option to specify which IIS site to deploy to (the equivalent of the "Site/application" box on the publish settings dialog in vs2010).

Finally, I don't mind if it's web deploy only, my file-based deployment is a product of laziness, and I can set up a web deploy agent on the appropriate box, I just haven't had to yet.

I've been searching for information about this, but it's pretty hard to find, I think.

Any pointers?

1 Answer 1

4

Ok, I think I've found this. msbuild can do it.

C:\path\to\project>msbuild 
     /p:configuration="Config1" 
     /p:DeployOnBuild=True 
     /p:DeployTarget=MsDeployPublish 
     /p:CreatePackageOnPublish=True 
     /p:DeployIISAppPath="Default Web Site or whatever" 
     /p:MsDeployServiceUrl="http://machine/MSDEPLOYAGENTSERVICE"
     /p:AllowUntrustedCertificate=true 
     /p:UserName=DOMAIN\user
     /p:Password=thePassword
     /p:MsDeployPublishMethod=RemoteAgent 
     /p:SkipExtraFilesOnServer=true

x4 in a batch file.

Sign up to request clarification or add additional context in comments.

1 Comment

I know there's similar questions on SO, but I couldn't find them until after I'd written this question. Maybe this will add exposure, at least.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.