2016-12-12 3 views
0

msdeploy.exeを使用してbambooにデプロイメントを行いたいとします。bambooコマンドタスクの空きスペースをエスケープする方法

私は、エージェント 上msdeploy.exeを実行し、引数でそれを実行しようとするコマンドを設定します。

-verb:sync -source:contentPath="${bamboo.build.working.directory}" -dest:contentPath="Default Web Site/application-name",ComputerName="http://server/MSDeployAgentService",userName=user-name,password=password -verbose

このコマンドは、私の地元のCMDからうまく動作します。

はしかし、竹の上に私はエラーを得た:

Unrecognized argument '"-dest:contentPath="Default'. All arguments must begin with "-" It suggests that treat "Web.." as a second parameter because of an empty space.

私はいくつかのことが、成功せずに試してみました:

Encode with %20
"Default Web Site/application-name" -> "Default%20Web%20Site/application-name"
Result - Default%20Web%20Site doesn't exist
This works when I were using msbuild.
Escape with ^
^"Default Web Site/application-name^"
Result: "Unrecognized argument..."
Using single quotes '
'Default Web Site/application-name'
Result: "Unrecognized argument..."

竹のドキュメンテーションを使用するように言う:「あなたがしたい引数をに渡します空白を含む引数は引用符で囲まなければなりません " しかし私は既に私のパラメータを引用しました。

答えて

0

それだprobabalyので、5歳の竹問題の:

Synchronize.ps1スクリプト:あなたが入力パラメータとしてパスを取るPowerShellスクリプトを作成して、竹などからそれを実行することができます回避策としてhttps://jira.atlassian.com/browse/BAM-10740

Param(
[Parameter(Mandatory=$true)] 
[string]$Server, 
[Parameter(Mandatory=$true)] 
[string] $UserName, 
[Parameter(Mandatory=$true)] 
[string] $Password, 
[Parameter(Mandatory=$true)] 
[string]$LocalPath, 
[Parameter(Mandatory=$true)] 
[string]$RemotePath 
) 

Write-Host "Synchronize contents of $RemotePath on host $Server" 

& "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:contentPath="$LocalPath" -dest:contentPath="$RemotePath",ComputerName="http://$Server/MSDeployAgentService",userName=$UserName,password=$Password -verbose 

やパラメータなどで竹のPowerShellスクリプトタスクSynchronize.ps1を追加します。

-Server ${bamboo.My_Server} -LocalPath '${bamboo.build.working.directory}\Artifacts' -RemotePath 'D:\My app\My folder\' ... 

欠点は、Web配布がエージェントホストなどで利用可能であることを確認する必要があることです。 5.13より古いバージョンのbambooを実行している場合は、ダミーWebデプロイダンプタスクを追加します。

関連する問題