我有一个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.
更多推荐
发布评论