学习TeamCity。遵循https://confluence.jetbrains.com/pages/viewpage.action?pageId=54334902的说明 写了这样的命令:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-source:package="C:\ProgramData\JetBrains\TeamCity\artifacts\webdeploy\Development\<target environment>\TestWebApplication.zip"
-dest:auto,
computerName="https://<windows azure web site web publish URL>:443/msdeploy.axd?site=<windows azure web site name>",
userName="<deployment user name>",
password="<deployment password>",
authtype="Basic",
includeAcls="False"
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
作为命令行构建步骤。
所有参数都已在当前构建配置中的参数中设置。 在运行构建时,我遇到了这样的异常:
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
'computerName' is not recognized as an internal or external command,
operable program or batch file.
'userName' is not recognized as an internal or external command,
operable program or batch file.
'password' is not recognized as an internal or external command,
operable program or batch file.
'authtype' is not recognized as an internal or external command,
operable program or batch file.
'includeAcls' is not recognized as an internal or external command,
operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
Process exited with code 1
Step Command Line failed
我做错了什么?
答案 0 :(得分:3)
命令行确实应该是一行命令:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package="C:\ProgramData\JetBrains\TeamCity\artifacts\webdeploy\Development\<target environment>\TestWebApplication.zip" -dest:auto, computerName="https://<windows azure web site web publish URL>:443/msdeploy.axd?site=<windows azure web site name>", userName="<deployment user name>", password="<deployment password>", authtype="Basic", includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension
或为了更好的可读性,escape CR/LF
line endings使用^
插入符号,如下所示:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ^
-source:package='artifacts\WebDeploy\<target environment>\AcmeCompany.Portal.zip' ^
-dest:auto, ^
computerName="https://<windows azure web site web publish URL>:443/msdeploy.axd?site=<windows azure web site name>", ^
userName="<deployment user name>", ^
password="<deployment password>", ^
authtype="Basic", ^
includeAcls="False" ^
-verb:sync ^
-disableLink:AppPoolExtension ^
-disableLink:ContentExtension ^
-disableLink:CertificateExtension ^
-setParamFile:"msdeploy\parameters\<target environment>\AcmeCompany.Portal.SetParameters.xml"
老实说,如果使用的路径包含空格,我不确定正确引用-source:
参数目标:
-source:"package='artifacts\WebDeploy\real target environment\AcmeCompany.Portal.zip'"
关于使用'
单引号(撇号):
-source:"package=artifacts\WebDeploy\real target environment\AcmeCompany.Portal.zip"
或
-source:package="artifacts\WebDeploy\real target environment\AcmeCompany.Portal.zip"