开发者

How do I create an msdeploy manifest that includes destination properties like username and password?

开发者 https://www.devze.com 2022-12-13 09:03 出处:网络
After a week of struggling I just got the msdeploy handler up on IIS7 (cursing the back-ass documentation thereof). So know I have a simple sync \"working\" but I\'d like to move as much of the -sync

After a week of struggling I just got the msdeploy handler up on IIS7 (cursing the back-ass documentation thereof). So know I have a simple sync "working" but I'd like to move as much of the -sync parameters in a manifest rather than burying it in my MSBUILD task. Here is the deploy command line:

msdeploy.exe -verb:sync 
    -source:package="D:\Projects\Packaged.zip"
    -dest:iisApp="beta.mysite.com",
        wmsvc=ops.mysite.com,
        username=deployUser,
        password=secret,
        skipAppCreation=true 
    -allowUntrusted=true

I have found alot of examples of manifests that contain the iisApp path, but they usually move the other bits to a parameters file for (i'm guessing) user entry. Is there anything simple like this:

<!-- Pseudo-code manifest -->
<ms开发者_开发知识库deploy.iisApp>
  <iisApp path="beta.mysite.com">
    <param key="wmsvc" value="ops.mysite.com"/>
    <param key="SkipAppCreation" value="true"/> 
    <param key="username" value="deployUser"/> 
    <param key="password" value="secret"/> 
  </iisApp> 
</msdeploy.iisApp>


Not exactly the same scenario but might give some idea.
This is what we did trying to update our database with msdeploy.
First we created a manifest.xml where we tell msdeploy dbFullSql provider where to look for our sql scripts:

<sitemanifest>
  <dbfullsql path="test1.sql"/>
  <dbfullsql path="test2.sql"/>
  <dbfullsql path="test3.sql"/>
</sitemanifest>  

Then you need parameter.xml where you specify database connection string:

<parameters>
  <parameter
     name="ConnectionString"
     value="Data Source=localhost;uid=user;password=pass;multipleactiveresultsets=false;Initial Catalog=Db_name">
  <parameterEntry type="ProviderPath" scope="dbFullSql"/>
 </parameter>

Now we are ready to create a package with our manifest:

msdeploy.exe -verb:sync -source:manifest="manifest.xml" -dest:package="package.zip"

And finally deploy it:

msdeploy.exe -verb:sync -source:package="package.zip" -dest:auto -setParamFile="parameter.xml"

So you can see how you can keep your parameters in a separate file. Magic!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号