次のようなプロジェクト (WCF サービス アプリケーション) を公開するための msbuild コマンドがあります。
msbuild FooBar.Service.csproj /p:DeployOnBuild=true;
DeployTarget=MsDeployPublish;
MSDeployServiceUrl=http://server.pl/MSDeployAgentService;
DeployIisAppPath="Foobar";
MSDeployPublishMethod=RemoteAgent;
UserName=Joe;
password=secret;
これはVSコマンドプロンプトから機能し、すべてエラーなしで公開されます。ターゲットを指定していないことに注意してください。
しかし、TeamCity (7.1.5) を使用して展開プロジェクトを作成したいと考えています。私は単純なプロジェクトを実行し、1 つのビルド ステップで構成を行いました。
問題は、このタスクを実行しているときに、msbuild がサイトをコンパイルしますが、リモート サーバーに公開しないことです。以下はビルドログです。
[16:13:16]Checking for changes
[16:13:18]Publishing internal artifacts
[16:13:18][Publishing internal artifacts] Sending build.start.properties.gz file
[16:13:18]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[16:13:18]Checkout directory: C:\TeamCity\buildAgent\work\2eecf7b45f277a61
[16:13:18]Repository sources transferred
[16:13:18]Updating sources: server side checkout
[16:13:18]Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\2eecf7b45f277a61 /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[16:13:18]in directory: C:\TeamCity\buildAgent\work\2eecf7b45f277a61
[16:13:20]Foobar.csproj.teamcity: Build target: Build
[16:13:20][Foobar.csproj.teamcity] CoreCompile
[16:13:20][CoreCompile] Csc
[16:13:20][Csc] C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.EnterpriseServices.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ServiceModel.Web.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.ApplicationServices.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.DynamicData.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.Entity.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.Extensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.Services.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll" /debug+ /debug:full /optimize- /out:obj\Debug\Foobar.dll /subsystemversion:6.00 /target:library /utf8output Service1.svc.cs IService1.cs Properties\AssemblyInfo.cs "C:\TeamCity\buildAgent\temp\buildTmp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
[16:13:20][Foobar.csproj.teamcity] CopyFilesToOutputDirectory
[16:13:20][CopyFilesToOutputDirectory] Copy
[16:13:20][Copy] Copying file from "obj\Debug\Foobar.dll" to "bin\Foobar.dll".
[16:13:20][CopyFilesToOutputDirectory] Foobar.csproj -> C:\TeamCity\buildAgent\work\2eecf7b45f277a61\bin\Foobar.dll
[16:13:20][CopyFilesToOutputDirectory] Copy
[16:13:20][Copy] Copying file from "obj\Debug\Foobar.pdb" to "bin\Foobar.pdb".
[16:13:19]Targets was not defined in the build configuration.
[16:13:19]MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead.
[16:13:21]Process exited with code 0
[16:13:21]Publishing internal artifacts
[16:13:21][Publishing internal artifacts] Sending build.finish.properties.gz file
[16:13:21]Publishing artifacts
[16:13:21][Publishing artifacts] Collecting files to publish: [C:\TeamCity\buildAgent\work\2eecf7b45f277a61]
[16:13:21][Publishing artifacts] Sending
[16:13:21]Build finished