根据 TeamCity 中的父配置查找所有构建配置?

发布于 2024-11-28 18:56:02 字数 457 浏览 2 评论 0原文

在(仍未回答)问题在 TeamCity 中设置大型持续集成的首选方式可能是什么 我们已经设置了很多快照依赖项。

现在,假设您有配置 A、B、C、D 和 E,它们取决于配置 Z。三个月过去了。

现在假设您想要从配置 Z 切换到 X,可能是因为您使用该配置在不同的构建代理上测试了许多不同的设置。您想要推出这些更改。并且您不希望仅仅因为手动复制已经使用配置 X 成功测试过的配置设置而对开发人员强制实施 CI 停机。

因此,将依赖项配置 Z 切换到不同的配置 X 并将所有依赖配置切换到这个新配置配置:你怎么知道哪些配置仍然依赖于Z?

谢谢-斯特凡

In the days following the (still unanswered) question what the preferred way for a big continuous integrations setup in TeamCity might be we have been setting up a lot of snapshot dependencies.

Now, image you have configuration A, B, C, D and E which are depending on configuration Z. Three months are passing.

Now assume you want to switch from configuration Z to X, maybe because it is a configuration with which you tested a lot of different settings on different build agents. And you want to roll out those changes. And you do not want to enforce CI downtimes for developers just because you are manually copying configuration settings around you already have tested successfully with configuration X.

So to switch a dependency configuration Z to a different configuration X and to switch all dependent configurations to this new configuration: How do you still know then which configurations are still depending on Z?

Thanks - Stefan

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

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

发布评论

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

评论(1

心的位置 2024-12-05 18:56:02

尽管 TeamCity 可以很好地跟踪每个构建的依赖关系,但我不知道 UI 中是否有页面允许您查看依赖于给定“父”配置的构建配置列表。
您当然可以查看每个单独的配置来找出这一点,但这在大型部署中可能不可行。

如果您想在单个位置或以编程方式访问此信息,TeamCity 会将其存储在\config\< 中的 project-config.xml 文件中。项目名称>目录。

<project id="project1">
  <build-type id="bt1" name="Parent">
    ...
  </build-type>

  <build-type id="bt2" name="Child 1">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>

  <build-type id="bt3" name="Child 2">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>
</project>

在上面的示例中,您可以查找任何具有 settings/dependencies/depends-on 节点且 sourceBuildTypeId 与您的匹配的 build-type父配置id
即使您的依赖项跨越多个项目,此方法也应该仍然有效,因为构建类型 ID 在 TeamCity 安装上是唯一的。

Although TeamCity has a good view tracking of dependencies on a per-build basis, I'm not aware of a page in the UI that allows you to see a list of build configurations that depend on a given "parent" configuration.
You can of course view each individual configuration to find this out, but that may not be feasible in your large deployment.

If you'd like to access this information in a single place or programmatically, it's stored by TeamCity in a project-config.xml file in your <TEAMCITY-DATA-DIR>\config\<PROJECT-NAME> directory.

<project id="project1">
  <build-type id="bt1" name="Parent">
    ...
  </build-type>

  <build-type id="bt2" name="Child 1">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>

  <build-type id="bt3" name="Child 2">
    ...
    <settings>
      <dependencies>
          <depend-on sourceBuildTypeId="bt1">
          ...
          </depend-on>
      </dependencies>
    </settings>
  </build-type>
</project>

In the above example, you could look for any build-type that had a settings/dependencies/depends-on node with a sourceBuildTypeId matching your parent configuration id.
This approach should still work even if your dependencies span multiple projects, as the build type ids are unique on the TeamCity installation.

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