zoukankan      html  css  js  c++  java
  • MSDeploy使用备忘

          使用MSDeploy命令行部署站点的时候,碰到一个问题:默认情况下,部署的过程中,会把目标目录下面的内容都清空,但是有的时候部署的站点已经有用户在使用,比如说内容维护,用户上传了一些文件到站点目录下面,,这样的话,部署的时候就造成会把用户的文件给清除了,也就是要想办法做到能控制部署的时候是否要清空目标目录,在在线MSDN帮助中找到答案:

    http://technet.microsoft.com/en-us/library/dd569019%28WS.10%29.aspx其中的如下例子:

    Unpackage the contents of the Package.zip file and put them in the C:\temp folder. Do not delete other files that already exist in the destination folder.

    msdeploy.exe -verb:sync -source:package=C:\package.zip -dest:contentpath=C:\temp -enableRule:DoNotDeleteRule

    只要在部署脚本中写入-enableRule:DoNotDeleteRule参数就可以了。如下所示:
    <Target Name="MSDeploy">
        <MSBuild Targets="Package" Projects="..\src\Avatar.Application.WuJingPortal.Web\Avatar.Application.WuJingPortal.Web.csproj" ContinueOnError="false" Properties="PackageLocation=..\..\output\Package.zip"/>
        <Exec Command="..\output\Package.deploy.cmd /Y /m:$(DeployServerIP) /u:$(DeployUser) /p:&quot;$(DeployPossword)&quot; -enableRule:DoNotDeleteRule" ContinueOnError="false" IgnoreExitCode="true" />
      </Target>

     问题解决。

       部署过程中,要确保目标主机的80端口是可以访问的,要不然会出现部署失败的情况。

  • 相关阅读:
    前端Ajax/JS/HTML+后端SpringMVC(二)
    前端Ajax/JS/HTML+后端SpringMVC(一)
    Redis 简介及应用
    项目中使用 MyBatis(二)
    L2d插件
    [转载] 栈内存和堆内存
    Hbase排错
    matplotlib中文乱码
    cocos2dx 一些好网站
    esclipe中接入SDK时引用另一个工程或Jar
  • 原文地址:https://www.cnblogs.com/Nevaeheerf/p/2663631.html
Copyright © 2011-2022 走看看