2015-01-19 2 views
0

TeamCity 빌드에서 Powershell 스크립트를 실행할 때 오류가 발생합니다. 이 스크립트는 PackageWeb이라는 Nuget 패키지에서 가져온 것입니다. 스크립트는 MSDeploy 패키지를 가져 와서 원격 컴퓨터에서 실행되는 IIS 인스턴스에 배포합니다. 스크립트는 here으로 읽을 수 있습니다. 내가 오류는 다음과 같다 :TeamCity 빌드에서 PackageWeb Powershell 스크립트를 실행하는 중 오류가 발생했습니다.

두 번째 줄은 범인, 및 '앱 이름 "단어 사이의 공간이어야한다
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync 
-source:archiveDir="C:\TeamCity\buildAgent\temp\buildTmp\App Name.csproj_zip" - 
dest:auto,includeAcls='False', 
ComputerName='mycomputer',Username=hurry,Password=up,AuthType='NTML' 
-disableLink:AppPoolExtension 
-disableLink:ContentExtension -disableLink:CertificateExtension 
-setParamFile:"C:\TeamCity\buildAgent\temp\buildTmp\App Name.csproj_zip\SetParameters.xml" -whatif - 
skip:objectName=dirPath,absolutePath="_Deploy_" - 
skip:objectName=filePath,absolutePath=web\..*\.config -skip:objectName=dirPath,absolutePath=_Package 
-skip:objectName=filePath,absolutePath=.*\.wpp\.targets$ -allowUntrusted -enableRule:DoNotDelete 

The term 'C:\TeamCity\buildAgent\temp\buildTmp\App' is not recognized as the name 
of a cmdlet, function, script file, or operable program. 
Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again. 

가 문제가있을 수 있습니다,하지만 난이 탈출 할 수있는 방법을 발견하지 않았습니다 정확히. "App Name"은 msdeploy 패키지의 zip 파일 이름 ("App Name.csproj_zip"이라고 함)에서 가져옵니다.

TeamCity에서 Powershell을 실행하면 msdeploy 경로에 공백이 허용되지 않는 이유는 무엇입니까?

+1

가 관련 될 수있다 : http://stackoverflow.com/questions/3499699/how-do-you-call-msdeploy-from- powershell-when-spaces-have-spaces/12813048 # 12813048 –

+0

감사 데이빗, 예, 거기에 언급 된 대부분의 것들을 시도했지만 행운이 없습니다. – Torfi

답변

0

저는 Powershell + MSDeploy + TeamCity를 뒤범벅하고 있으며 다음과 같은 기능이 작동합니다. 그 파라미터를 참고 {3} (공간 포함) MSDeploy 경로

function Deploy([string]$server, [string]$remotePath, [string]$localPath) { 
     $msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"; 
     cmd.exe /C $("`"{3}`" -verb:sync -source:contentPath=`"{0}`" -dest:computerName=`"{1}`",contentPath=`"{2}`" " -f $localPath, $server, $remotePath , $msdeploy) 
    } 
관련 문제