gpt4 book ai didi

continuous-integration - 获取 MSDeploy 以跳过文件夹中的特定文件夹和文件类型作为 CCNet 任务

转载 作者:行者123 更新时间:2023-12-04 08:41:34 26 4
gpt4 key购买 nike

我想要 MSDeploy 到 skip使用同步时其他文件夹中的特定文件夹和文件类型。目前,我正在使用 CCNet 使用同步动词调用 MSDeploy,以将网站从构建转移到登台服务器。因为目标上有应用程序/用户上传的文件等创建的文件,我需要exclude specific folders from being deleted on the destination .还有由站点创建的 list 文件需要保留在目标上。

目前我用过 -enableRule:DoNotDeleteRule但这会在目的地留下陈旧的文件。

<exec>
<executable>$(MsDeploy)</executable>
<baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
<buildArgs>-verb:sync
-source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\"
-dest:iisApp="$(website)/$(websiteFolder)"
-enableRule:DoNotDeleteRule</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
<successExitCodes>0,1,2</successExitCodes>
</exec>

我曾尝试使用跳过操作,但遇到了问题。最初我放弃了 DoNotDeleteRule 并将其替换为(多个)跳过
<exec>
<executable>$(MsDeploy)</executable
<baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
<buildArgs>-verb:sync
-source:iisApp="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\"
-dest:iisApp="$(website)/$(websiteFolder)"
-skip:objectName=dirPath,absolutePath="assets"
-skip:objectName=dirPath,absolutePath="survey"
-skip:objectName=dirPath,absolutePath="completion/custom/complete*.aspx"
-skip:objectName=dirPath,absolutePath="completion/custom/surveylist*.manifest"
-skip:objectName=dirPath,absolutePath="content/scorecardsupport"
-skip:objectName=dirPath,absolutePath="Desktop/docs"
-skip:objectName=dirPath,absolutePath="_TempImageFiles"</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
<successExitCodes>0,1,2</successExitCodes>
</exec>

但这会导致以下结果:


Error: Source (iisApp) and destination (contentPath) are not compatible for the given operation.
Error count: 1.



所以我从 iisApp 更改为 contentPath 而不是 dirPath,absolutePath 只是像这样的目录:
<exec>
<executable>$(MsDeploy)</executable
<baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
<buildArgs>-verb:sync
-source:contentPath="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\"
-dest:contentPath="$(website)/$(websiteFolder)"
-skip:Directory="assets"
-skip:Directory="survey"
-skip:Directory="content/scorecardsupport"
-skip:Directory="Desktop/docs"
-skip:Directory="_TempImageFiles"</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
<successExitCodes>0,1,2</successExitCodes>
</exec>

这给了我一个错误:路径中的非法字符:

< buildresults>
Info: Adding MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding contentPath (C:\WWWRoot\MySite
-skip:Directory=assets
-skip:Directory=survey
-skip:Directory=content/scorecardsupport
-skip:Directory=Desktop/docs
-skip:Directory=_TempImageFiles).
Info: Adding dirPath (C:\WWWRoot\MySite
-skip:Directory=assets
-skip:Directory=survey
-skip:Directory=content/scorecardsupport
-skip:Directory=Desktop/docs
-skip:Directory=_TempImageFiles).
< /buildresults>

< buildresults>
Error: Illegal characters in path.
Error count: 1.
< /buildresults>



所以我需要知道如何配置这个任务,这样引用的文件夹就不会在同步中删除它们的内容,并且完成/自定义文件夹中的 *.manifest 和 *.aspx 文件也被跳过。

最佳答案

问题是……换行!
我将每个 -skip 指令拆分为导致路径中出现非法字符的新行。内联运行所有跳过指令已经解决了这个问题:

<exec>
<executable>$(MsDeploy)</executable>
<baseDirectory>$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\</baseDirectory>
<buildArgs>-verb:sync
-source:contentPath="$(ProjectsDirectory)$(projectName)$(ProjectsWorkingDirectory)\Website\"
-dest:contentPath="C:\WWWRoot\$(websiteFolder)" -skip:Directory="assets" -skip:Directory="_TempImageFiles" -skip:objectName=dirPath,absolutePath="\\Desktop\\Docs"
</buildArgs>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
<successExitCodes>0,1,2</successExitCodes>
</exec>

关于continuous-integration - 获取 MSDeploy 以跳过文件夹中的特定文件夹和文件类型作为 CCNet 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11152852/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com