如果只有SCM注释匹配模式,请运行jenkins作业 [英] Run jenkins job if only SCM comment match pattern

查看:54
本文介绍了如果只有SCM注释匹配模式,请运行jenkins作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅当svn消息符合特定模式(即

I would like to run a Jenkins job only if the svn message matches a certain pattern i.e.

当我发布新的应用程序版本并提交时

When I release a new application version and commit it

svn commit -m发行版本0.x"

svn commit -m "release version 0.x"

Jenkins匹配该消息并运行一个名为发布"的作业.如果消息不匹配,则将忽略此提交.

Jenkins matches the message and runs a job called "release". If the message does not match then this commit is ignored.

推荐答案

您可以通过使用作业配置中的排除提交的注释"字段来尝试使用它.仅当您单击Subversion选项旁边的扩展"按钮时,它才可见.

You could try it by using the "Excluded Commit comments" field in the job configuration. It is only visible when you click on the "Extended" Button next to the Subversion options.

您需要编写一个可以匹配所有内容的正则表达式,但是要捕获的注释(例如,"[^(?: release)]"可能会起作用,假设您的意思是发布而不是意识到).试一试.

You need to write a regular expression that will match everything, but the comment you want to capture (e.g. "[^(?:release)]" might work, assuming you meant release, not realize). Give this a shot.

这篇关于如果只有SCM注释匹配模式,请运行jenkins作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆