检测到提交消息中的关键字时忽略构建步骤(Ignore build step when a keyword in commit message is detected)

编程入门 行业动态 更新时间:2024-10-24 13:29:47
检测到提交消息中的关键字时忽略构建步骤(Ignore build step when a keyword in commit message is detected)

我有一个VCS trigger ,每次检测到特定分支中的新提交时都会启动构建。 但有时我想要跳过其中一个步骤。 我决定在这样的提交中添加一个特定的关键字。

我尝试使用模板和两个配置(一个启用了步骤,另一个启用了禁用),但是不可能在派生配置中修改VCS Trigger属性。 此外,我无法向配置或模板添加第二个VCS Trigger :当我单击“添加”时,列表中没有VCS Trigger 。

如何做呢?

I have a VCS trigger which starts build each time a new commit in specific branch is detected. But sometimes I want one of steps to be skipped. I decided to add a specific keyword to such commits.

I tried to use template and two configurations (one with step enabled and another with disabled) but there is no possibility to modify VCS Trigger properties in derived configurations. Also I can't add a second VCS Trigger neither to the configuration nor to the template: when I click "Add" there is no VCS Trigger in list.

How can it be done?

最满意答案

如果您有模板,则可以使用某些参数(例如%TRIGGER_RULES%)将硬编码值替换为VCS触发器规则。 在使用此模板的每个构建中,您可以根据需要轻松覆盖此参数。 这应该可以让你有类似的东西

-:comment=.*do-not-trigger.*

但是如果您只想跳过一步,那么在这种情况下,您必须为它创建一些自定义脚本并检查其中的提交消息。 构建的行为很简单:执行构建并触发所有步骤,或者根本不执行构建。

If you have template then you can replace VCS trigger rules from hardcoded values with some parameter, e.g. %TRIGGER_RULES%. And in each build, that uses this template you could easily override this parameter for your needs. This should give you possibility to make something like

-:comment=.*do-not-trigger.*

But if you would like to skip only one step, then in this case you have to create some custom script for it and check commit message in it. The behaviour of build is simple: either build is executed and all steps are triggered, or build is not executed at all.

更多推荐

本文发布于:2023-07-22 10:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219195.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:检测到   步骤   关键字   消息   Ignore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!