我想使用Jenkins webhook触发器触发一个管道,当接收到的事件失败或成功时,它只触发两种情况。enter image description here
例如:如果我有一个像下面这样的JSON事件日志
{"involvedObject":{"kind":"HelmRelease","namespace":"flux-system","name":"my-release","uid":"1f86243d-bcd9-4e0a-b078-c9df8f9441ac","apiVersion":"helm.toolkit.fluxcd.io/v2beta1","resourceVersion":"1466894"},"severity":"info","timestamp":"2023-10-25T06:20:18Z","message":"Helm upgrade succeeded","reason":"info","metadata":{"revision":"6.5.2"},"reportingController":"helm-controller","reportingInstance":"helm-controller-578bd944df-m9sgx"}
字符串
我希望此事件仅过滤使用regexp "Helm upgrade succeeded"
或"Helm upgrade failed"
的消息。如果任何其他过滤器与此消息分离,则不应触发我的管道。
任何对regexp的帮助都是很好的。|$success),(failed| success).. dint work**注意:**我正在使用Jenkins webhook Trigger插件用于上述用例,并在此插件下使用可选的过滤器。
1条答案
按热度按时间57hvy0tb1#
安装通用webhook触发器插件并尝试一下
字符串