【问题标题】:Jenkins conditional run step not matching詹金斯条件运行步骤不匹配
【发布时间】:2015-10-20 20:33:12
【问题描述】:

我正在尝试基于条件正则表达式匹配运行 Jenkins 构建步骤,但我不知道为什么它不匹配。

这是它在 Jenkins 中的外观:

我正在使用这个正则表达式:.*iOS. 反对构建参数 pmt_content。

这是 pmt_content 值:

<body><pre>^1234567890^abc123def132afd1213afas^iOS^Test User^test@abc.com^iPad 3^</pre><img src='https://cirrus.app47.com/notifications/5626a0bc9ac25b6ea7003f2f/img' alt=''/></body>

这是控制台日志,告诉我它不匹配。

[PollMailboxTrigger] An email matching the filter criteria was found. (log)
Building in workspace /Users/jenkins/.jenkins/jobs/New Device Listener/workspace
Run condition [Regular expression match] enabling prebuild for step [Execute shell]
Regular expression run condition: Expression=[.*iOS.*], Label=[
<body><pre>^1234567890^abc123def132afd1213afas^iOS^Test User^test@abc.com^iPad 3^</pre><img src='https://cirrus.app47.com/notifications/5626a0bc9ac25b6ea7003f2f/img' alt=''/></body>]
Run condition [Regular expression match] preventing perform for step [Execute shell]
Finished: SUCCESS

显然 pmt_content 包含“iOS”。

我在 www.regexplanet.com 上测试了相同的值。

我做错了什么?

【问题讨论】:

    标签: regex plugins jenkins


    【解决方案1】:

    由于标签数据中的换行符阻止了匹配,我遇到了类似的挫败感。从你的转储中很难判断一开始是否有换行符。无论如何,您可以尝试(?is).*iOS.*Reference.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-08
      • 1970-01-01
      • 1970-01-01
      • 2016-02-21
      • 1970-01-01
      • 1970-01-01
      • 2013-02-14
      相关资源
      最近更新 更多