如何将IIS 7 Web部署与MSBuild(TeamCity)集成?
答案 0 :(得分:38)
答案 1 :(得分:16)
这是很多步骤,一切都可能出错。我会进一步调查和博客,但这是我的第一次尝试。
我正在使用此设置:
这是MSBuild脚本:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</PropertyGroup>
<Import Project="Webapplication.csproj" />
<Target Name='Deploy' DependsOnTargets='Build;Package' >
<Exec Command='"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe"
-source:contentpath="$(teamcity_build_checkoutDir)\Main\source\Webapplication\obj\Release\Package\PackageTmp\"
-dest:contentpath="c:\inetpub\Webapplication\www",includeAcls=false,computername="https://(stagingserver-name):8172/msdeploy.axd?Site=Webapplication",authType=Basic,userName=(staginserver-name)\webdeploy,password=********
-allowUntrusted
-verb:sync' />
</Target>
</Project>
关键点:
制剂
Team City:
我使用上面的MSBuild脚本设置了新的构建配置,并将目标设置为Deploy