删除 Teamcity 工件中的目录结构

发布于 2024-12-12 04:13:48 字数 354 浏览 0 评论 0原文

我使用 Teamcity 构建不同的包,并希望将这些包保存为工件。我在 TeamCity 中的工件路径如下:

%system.teamcity.build.workingDir%\**\Release**/*.wsp => Solution 

现在,TeamCity 在正确构建后会收集任何发布目录中的所有 WSP 文件。但它被保存,包括所有子目录,例如:

How the Files are beingprovided

我只想要直接在 " 下的 .wsp 文件解决方案”,没有目录树。

I use Teamcity to build different packages and want to save those Packages as Artifacts. My Artifact Path in TeamCity is the following:

%system.teamcity.build.workingDir%\**\Release**/*.wsp => Solution 

Now TeamCity collects all WSP-Files in any Release-Directory after building correctly. But it is saved including all subdirectories like:

How the Files are being offered

I only want the .wsp-File directly under "solution" without the directory tree.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

酒与心事 2024-12-19 04:13:48

来自 TeamCity 文档:

通配符 — 发布与类似 Ant 通配符模式匹配的文件(“”和
仅支持“*”通配符)。通配符应该代表一个
相对于构建签出目录的路径。 文件将是
发布保留匹配的目录结构

通配符(不会创建与“静态”文本匹配的目录)。
也就是说,TeamCity 将从第一个目录开始创建目录
模式中出现通配符。

http://confluence.jetbrains.net/display/TCD65/Configuring +General+Settings#ConfiguringGeneralSettings-artifactPaths

在构建脚本(或其他最终构建步骤)中,您必须将必要的文件复制到单个文件夹中并将该文件夹发布为 Artifacts

From TeamCity docs:

wildcard — to publish files matching Ant-like wildcard pattern ("" and
"*" wildcards are only supported). The wildcard should represent a
path relative to the build checkout directory. The files will be
published preserving the structure of the directories
matched by the
wildcard (directories matched by "static" text will not be created).
That is, TeamCity will create directories starting from the first
occurrence of the wildcard in the pattern.

http://confluence.jetbrains.net/display/TCD65/Configuring+General+Settings#ConfiguringGeneralSettings-artifactPaths

In your build script ( or additional final build step) you will have to copy the necessary files to a single folder and publish that folder as Artifacts

远山浅 2024-12-19 04:13:48

您可以通过修改 yout .csproj 文件中的 OutputPath 或在构建 .sln 时输入 OutDir 属性覆盖来实现某些目的,而不是像 @manojlds 建议的那样进行复制(如果您是的话)。请注意,这些方法都不是完美的 - 例如,TeamBuild(Visual Studio ALM 工具中的 CI 服务器)将所有内容重定向到一个目录,这可能会导致完全混乱,并且仅适用于最简单的情况。

Instead of copying as @manojlds suggests, you might be able to achieve something by modifying the OutputPath in yout .csproj file, or feeding in an OutDir property override when building a .sln (if you are). Be warned that neither of these approaches are perfect - for example, TeamBuild (the CI server in the Visual Studio ALM Tooling) redirects everything into one directory, which can cause a complete mess and only works for the most simple cases.

月隐月明月朦胧 2024-12-19 04:13:48

我遇到了这个问题,我想从子目录收集各种安装文件。添加 PowerShell 运行程序作为构建步骤非常强大,并且很好地解决了这个问题...

get-childitem -Recurse -Include *.wsp | Move-Item -destination .

这将在 TeamCity 查看工件之前将它们移动到根目录,其中诸如 *.wsp 之类的基本工件路径可以选取它作为最终输出。

I had this issue where I wanted to gather various install files from subdirectories. Adding a PowerShell runner as a build step is quite powerful and solves this nicely...

get-childitem -Recurse -Include *.wsp | Move-Item -destination .

This will move them to the root prior to TeamCity looking at the artifacts, where the basic artifact paths like *.wsp can pick it up for the final output.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文