如何确保同一项目的团队城市构建配置按特定顺序运行?

发布于 2024-07-20 15:30:43 字数 595 浏览 2 评论 0原文

我的设置:一个项目有两个构建配置(“ci”和“reset dbs”)

  • “ci”只是该项目的常规 ci 构建

  • “重置数据库”使用相同的 VCS,但仅触发“common\database”文件夹中的构建(运行测试所需的数据库重置) (触发模式:+:Common/Database/**)

现在 - 我希望当我将内容检查到“database”文件夹中时 - “reset dbs”构建始终在常规“ci”构建之前运行。

我现在所做的是将“ci”构建的安静期设置为与 VCS 的轮询间隔相同 - 这应该让我“重置数据库”始终首先运行,对吧?

到目前为止似乎正在工作(一些测试提交) - 但我希望它完全正确。

有一个更好的方法吗?

我看到另一种方法是复制“ci”配置,并在重置构建后触发一个名为“重置后的ci”的配置。 然后让常规的“ci”排除“database”文件夹。 感觉就像黑客。

谢谢你!

更新:整个想法是不必在每次提交时运行“重置数据库”,而只需在需要时运行 - 在这种情况下,它必须在“ci”构建之前运行。 感谢到目前为止的回复!

My setup: One project with two build configs ("ci" and "reset dbs")

  • the "ci" is just a regular ci build of the project

  • the "reset dbs" uses the same VCS but only triggers builds in the "common\database" folder (runs reset of the databases required for the tests)
    (trigger pattern: +:Common/Database/**)

Now - I would that when I check stuff into the "database" folder - the "reset dbs" build is always run BEFORE the regular "ci" build.

What I've done now is set the quiet period of the "ci" build to the same as the poll interval for the VCS - that SHOULD give me that the "reset dbs" always runs first right?

Seems to be working so far (a couple of test commits) - but I want it to totally correct.

Is there a better way to do this?

I see one other way of doing it which would be to copy the "ci" config and have one called "ci after reset" that is triggered after the reset build. And then let the regular "ci" exclude the "database" folder. Feels like a hack.

Thank you!

Update: The whole idea is to not have to run the "reset dbs" on every commit, but just when needed - and in that case it has to run before the "ci" build. Thanks for the responses so far!

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

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

发布评论

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

评论(3

独行侠 2024-07-27 15:30:43

您可以将“reset dbs”配置配置为由签入(默认)触发,并通过完成“reset dbs”配置来触发“ci”配置(称为“依赖项”触发器)。

You could configure the "reset dbs" config to be triggered by a checkin (the default), and have the "ci" config triggered by the completion of the "reset dbs" config (called a "dependency" trigger).

十二 2024-07-27 15:30:43

我不知道它是否解决了这个问题,但是“构建触发”下有一个名为“依赖项”的选项卡。 您可以在此处选择必须在当前构建之前运行的构建。

I don't know if it solves it, but theres a tab called dependencies under Build triggering. There you can select a build that must be run before the current build.

似梦非梦 2024-07-27 15:30:43

在 teamcity 的最新版本中,您可以配置构建优先级。 这可以通过以下方式解决您的问题:

  1. 设置“ci”和“reset dbs”以在它们应该使用构建触发器模式时触发(正如您似乎已经做的那样)。 触发器应指定对“database”文件夹的更改会触发这两种配置。

  2. 转到构建队列 -> 配置构建优先级。 现在给予“重置数据库”更高的优先级。

In recent versions of teamcity, you can configure build priorities. This could solve your problem in the following way:

  1. Set up "ci" and "reset dbs" to trigger when they should using build trigger patterns (as you already seem to do). The triggers should specify that changes to the "database" folder triggers both configurations.

  2. Go to Build Queue -> Configure Build Priorities. Now give a higher priority to "reset dbs".

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