Team City 模板和工件

发布于 2025-01-05 19:20:55 字数 264 浏览 1 评论 0原文

我最近注意到我需要在许多项目中重用构建步骤。因此,我创建了一个模板,其中仅定义了构建步骤,并将需要它的项目与该模板关联起来。效果非常好。

但后来我意识到,尽管所有受影响的项目都已成功构建,但没有一个项目正在生成其工件。当我查看“常规设置”时,“工件路径”框呈灰色,Team City 告诉我只能在模板内更改它!

我希望我的构建具有不同的工件路径(有些甚至根本不生成工件),但我不想重复我的构建步骤。有一些解决方法吗?

团队城市版本:6.5.6(内部版本 18130)

I recently noticed I needed to reuse a build step in many projects. So I created a template where I only defined that build step, and had the projects that needed it associated with that template. That worked perfectly.

But then I realized that none of the affected projects were generating their artifacts, even though all of them were building successfully. When I went to look at the General Settings, the Artifact Paths box was grayed out and Team City told me that I could only change it inside the template!

I want my builds to have different artifact paths (some don't even generate artifacts at all), but I don't want to duplicate my build step. Is there some workaround for this?

Team City Version: 6.5.6 (build 18130)

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

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

发布评论

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

评论(2

深府石板幽径 2025-01-12 19:20:55

这就是我解决该问题的方法:

  • 在模板的构建参数部分中创建配置参数。我只是称之为工件

Artifact template parameter

  • 然后引用模板中Artifacts Paths框中的属性,例如%Artifacts%

Artifact paths image

  • 然后,对于继承模板的每个配置,您可以使用以下路径覆盖工件配置参数: 相关的。

工件覆盖参数

HTH

This is how I workaround the issue:

  • Create a configuration parameter in the build parameters section of the template. I just call it Artifacts.

Artifact template parameter

  • Then reference the property in the Artifacts Paths box in the template, e.g %Artifacts%

Artifact paths image

  • Then for each configuration which inherits the template you can override the artifacts configuration parameter with a path that is relevant.

Artifact override parameter

HTH

音盲 2025-01-12 19:20:55

这是一个老问题,显然只影响 TeamCity 版本低于 8.1 的用户(如已接受答案的评论中所指出的)。

根据官方文档

自 TeamCity 8.1 起,现在可以在从模板继承的构建配置中覆盖以下设置:

  • 内部版本号格式
  • 工件路径
  • 构建选项(挂起构建检测、状态小部件、同时运行的构建数量)
  • VCS 结帐模式
  • 结账目录
  • 构建前清理所有文件
  • 显示快照依赖项的更改
  • 执行超时
  • 所有常见的构建失败情况,包括执行超时

This is an old question and apparently only affects users with TeamCity versions less than 8.1 (as pointed out in the comments to the accepted answer).

According to the offical documentation:

Since TeamCity 8.1, the following settings can now be overridden in a build configuration inherited from a template:

  • build number format
  • artifact paths
  • build options (hanging builds detection, status widget, number of simultaneously running builds)
  • VCS checkout mode
  • checkout directory
  • clean all files before build
  • show changes from snapshot dependencies
  • execution timeout
  • all common build failure conditions, including execution timeout
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文