2011-12-14 50 views
0

我花了一整天的时间与一个我一直无法解决的问题作斗争。问题在于,我正在将Jenkins CI环境迁移到另一台服务器,并在Jenkins中创建另一个工作来处理实时部署。实时部署在新服务器上进行,而不是在开发服务器上进行。在过程结束时,我遇到了问题。无法上传目录:MSBuild和Jenkins问题

部署到UAT输出是:

GenerateSampleDeployScript: 
    Sample script for deploying this package is generated at the following location: 
    C:\Builds\Mcfc\Service\UAT\Mcfc\Build\WebServices\FulfillmentWebService\obj\UAT\Package\FulfillmentWebService.deploy.cmd 
    For this sample script, you can change the deploy parameters by changing the following file: 
    C:\Builds\Mcfc\Service\UAT\Mcfc\Build\WebServices\FulfillmentWebService\obj\UAT\Package\FulfillmentWebService.SetParameters.xml 
Done Building Project "C:\Builds\Mcfc\Service\UAT\Mcfc\Build\WebServices\FulfillmentWebService\FulfillmentWebService.csproj" (Package target(s)). 
Done Building Project "C:\Builds\Mcfc\Service\UAT\Mcfc\scripts\main.xml" (Transfer target(s)). 

Build succeeded. 

但住回报部署这样的:

GenerateSampleDeployScript: 
    Sample script for deploying this package is generated at the following location: 
    C:\Builds\Mcfc\Service\Production\Mcfc\Build\WebServices\FulfillmentWebService\obj\Production\Package\FulfillmentWebService.deploy.cmd 
    For this sample script, you can change the deploy parameters by changing the following file: 
    C:\Builds\Mcfc\Service\Production\Mcfc\Build\WebServices\FulfillmentWebService\obj\Production\Package\FulfillmentWebService.SetParameters.xml 
Done Building Project "C:\Builds\Mcfc\Service\Production\Mcfc\Build\WebServices\FulfillmentWebService\FulfillmentWebService.csproj" (Package target(s)). 
C:\Builds\Mcfc\Service\Production\Mcfc\scripts\Production.xml(143,5): error : CDUP successful. "/Mcfc/Production/SOA/AuctionWebService" is current directory. 
C:\Builds\Mcfc\Service\Production\Mcfc\scripts\Production.xml(143,5): error : 
C:\Builds\Mcfc\Service\Production\Mcfc\scripts\Production.xml(143,5): error : Couldn't upload directory. 
Done Building Project "C:\Builds\Mcfc\Service\Production\Mcfc\scripts\Production.xml" (Transfer target(s)) -- FAILED. 

Build FAILED. 

部署脚本的初步认识部分如下:

142 <Target Name="Transfer" DependsOnTargets="Package"> 
143 <FtpUploadDirectoryContent 
144 ServerHost="secret" 
145 Port="21" 
146 Username="secret" 
147 Password="secret" 
148 LocalDirectory="$(LocalBuild)\WebServices\AuctionWebService\obj\$(Configuration)\Package\PackageTmp" 
149 RemoteDirectory="Mcfc/$(Configuration)/SOA/AuctionWebService" 
150 Recursive="true" 
151  /> 

我这一整天都有问题,所以所有的帮助,非常感谢。

感谢,

萨钦

回答

1

尝试附加最后一个斜线字符到LocalDirectory属性值如下:

LocalDirectory="$(LocalBuild)\WebServices\AuctionWebService\obj\$(Configuration)\Package\PackageTmp\" 

您也可以尝试重新编译FtpUploadDirectoryContent任务,使其包括当它记录异常时获取更详细的错误消息。