6

So I've got my deploy working on a build and I've set up my build to create a deployment package and execute the package on the target server. Great so far. Now however the application is expanding and I need to have different configurations per machine (account names and such like),

Can I specify what the file name of "setParameters.xml" for example to "Server1.SetParameters.xml" or similar ?

I've got it copying the files over the SetParameters.xml before each deploy for now but is seems in-elegant and should a file get locked for what ever the reason it would deploy the wrong settings to the wrong server.

4
  • Are you using msdeploy.exe yourself or are you using the Visual Studio integration (ie. Web Publishing Pipeline)? Commented Oct 4, 2012 at 11:41
  • I'm using the package that MsBuild Creates using the /p:DeployOnBuild=true and /p:DeployTarget=Package I'm then executing the package in the AfterDropBuild target using exec and a file path like _PublishedWebsites\Website_Package\Website.deploy.cmd /Y /M:Server1 /U:User /P:Password Which I think is the second option but if using msdeploy directly I'm happy to switch. Commented Oct 4, 2012 at 12:10
  • Hi @MarkBroadhurst can you share how did you copy/generate multiple setparameters.xml files? Commented Oct 4, 2018 at 1:56
  • @Bat_Programmer As I commented on the answer I used the following cmd Website.deploy.cmd /Y /M:Server1 /U:User /P:Pass -setParamFile:Server1.SetParameters.xml Commented Oct 5, 2018 at 8:10

1 Answer 1

12

Since you are using the WPP-generated deploy.cmd file, the simplest choice is to set %_DeploySetParametersFile% to a full path to your setParmeters file before you execute the deploy script.

SET _DeploySetParametersFile=c:\full\path\to\setParmaeters.xml
call Website.deploy.cmd

Alternatively, if you want to use msdeploy directly, you can specify -setParamFile:c:\full\path\to\setParmaeters.xml. For more information, see Web Deploy Operation Settings

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

1 Comment

I got it working with the following command Website.deploy.cmd /Y /M:Server1 /U:User /P:Pass -setParamFile:Server1.SetParameters.xml Thank you

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.