gpt4 book ai didi

node.js - 如何解决在 TeamCity 中创建 FileSet 时出现的 NAnt 错误?

转载 作者:搜寻专家 更新时间:2023-10-31 23:09:14 25 4
gpt4 key购买 nike

我正在使用 TeamCity 构建和部署到我们的演示站点。我们有一个名为 HTML 演示站点的配置,构建步骤之一是使用 NAnt 将 HTML 部署到站点。

构建文件定义了一个目标:

<target name="deploy-html" description="Deploys the HTML to the demo server">
<echo message="Deploying HTML to the demo server..."/>
<copy todir="\\<server>\<dir>\<client>" includeemptydirs="true" overwrite="true">
<fileset basedir="..\html\_master">
<include name="**\*"/>
<exclude name="node_modules\**"/>
</fileset>
</copy>
</target>

每次我在 TeamCity 上运行构建时,都会失败并出现以下错误:

C:\tc\w\9149e011dfa8657d\build_scripts\website.build(27,14):
[NAnt output] Error creating FileSet.
[NAnt output] The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

所以我尝试在 PowerShell 上运行以获取超过最大长度的文件列表:

Get-ChildItem -Recurse | Where-Object {$_.FullName.Length -gt 248}

但是返回的唯一文件是 node_modules 目录下的文件。但是在构建文件中,它被排除在外。所以我不确定还有什么地方可以看?有什么想法吗?

最佳答案

你可以尝试一些事情:

  • 先删除 node_modules 目录
  • 使用 robocopy /mir <exec>任务
  • 尝试在包含之前先排除(不太可能,但值得一试)
  • 尝试将路径表达式更改为 name="node_modules\**\*"name="**\node_modules\**"或类似

关于node.js - 如何解决在 TeamCity 中创建 FileSet 时出现的 NAnt 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29411633/

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