电子邮件中的 Jenkins 控制台输出 table

Jenkins console output table in email

在 Jenkins 控制台输出中将显示以下 table。行数将根据构建输出而有所不同。 table 以 Summary: 开头,以 "Total" 结尾,后跟“=”符号行。

Summary:
------------
|Row1
------------
|Row2
============
Total
============

我们正在使用 email-ext 插件。如何使用 ${BUILD_LOG_REGEX} 或 ${BUILD_LOG_EXCERPT}.

在电子邮件中包含此 table

找到在电子邮件中包含 table 的正则表达式。

<pre>${BUILD_LOG_REGEX, regex="^-+$|^=+$", linesBefore=1, showTruncatedLines=false }</pre>

-=开头的行与正则表达式匹配,linesBefore=1获取以|showTruncatedLines=false开头的行删除所有不需要的内容。电子邮件中仅显示 table 格式。