Jenkins:可编辑电子邮件通知的触发器类型解释

Jenkins: Trigger types explanation for Editable Email Notification

在 Jenkins 中为 Editable Email Notification 创建触发器:

以下items/options:

问题

是否有官方文档解释 select 框中显示的每个项目? - 当然,有些很明显,有些则没有

吉拉

以防万一我创建了:

Email Extension, Triggers

Once you have added a trigger, you have several options. To see what conditions must be met for this plugin to send an email, click on the "?" (question mark) next to the trigger.

所以,在添加触发器后实际看到它的内联帮助()。

我同意插件页面上缺乏全面描述并强迫用户添加每个选项并单击 (?) 以找出其目的是一种糟糕的用户体验。然而,大多数情况似乎是不言自明的。 JIRA feature improvement 是一个合理的请求。

基本用户可以合理地忽略其中的大部分,但作为开发人员,如果您认为您有一个需要特殊通知的 condition/state 转换,它可能包含在列表中。条件是in the code the descriptors are inside the individual help files <condition>/help.html.

条件类别是(不确定什么不明显):

  • 构建前
  • [如果]未建成
  • 已中止
  • 总是
  • [任何] 状态已更改
  • 失败;各种标准 [ 1st, 2nd, Any, Still, X ]
  • 失败 -> 不稳定(测试失败)
  • 不稳定(构建但测试失败);各种标准 [ 1st, Any, Still, F->S ]
  • 已修复(构建失败 -> 现在构建成功)
  • 成功
  • 运行 脚本(构建前/构建后)(脚本评估成功,发送电子邮件)

根据我对标准的解释(不是在下面阅读),Any 是任何失败,无论先前的结果如何。 1st 仅在第一次失败时,2nd 仅在第二次失败时,“X”在“ X" 次(或第 n 次)失败。 Still 是每次都在连续多次失败之后;所以不是第一次失败。 成功 将所有计数器重置为零。


我在此处提取了“帮助”解释(从 v.2.83 开始)(clone| grep | sed):

AbortedTrigger : An email will be sent if the build status is "Aborted". A build is aborted via the UI or API, but normally requires some sort of user intervention to occur. An aborted build is stopped during its execution.

AlwaysTrigger : Always triggers an email after the build, regardless of the status of the build.

BuildingTrigger : An email will be sent any time the build goes from failing (compilation or build step failures), to unstable (unit test failures). This basically means that all the builds steps were successful, but there are still tests failing.

FailureTrigger : An email will be sent any time the build fails. If the "Failure - Still" trigger is configured, and the previous build status was "Failure", then the "Failure - Still" trigger will send an email instead.

FirstFailureTrigger : An email will be sent when the build status changes from "Success" to "Failure"

FirstUnstableTrigger : An email will be sent when the build status changes from anything to "Unstable".

FixedTrigger : An email will be sent when the build status changes from "Failure" or "Unstable" to "Success".

FixedUnhealthyTrigger : An email will be sent when the build status changes from "Failure" or "Unstable" to "Success". Intermediate "Aborted" builds are ignored.

ImprovementTrigger : An email will be sent any time there is an improvement. A build is considered to have improved whenever it has fewer test failures than the previous build. If the current failure count went to 0 (no more test failures) this trigger will NOT send an email.

NotBuiltTrigger : An email will be sent if the build status is "Not Built". This status code is used in a multi-stage build (like maven2) where a problem in earlier stage prevented later stages from building.

PreBuildScriptTrigger : the build occurs. The last line of the script should resolve to true to send an email, or false to not send an email. There are four objects added to the model for the script to use to interact with the build. Example:

// the last line in the script should resolve to a boolean true or false 
// only send am email if the previous build failed 
// this could be used to notify people that a new build is happening
build.previousBuild.result.toString().equals('FAILURE')

PreBuildTrigger : An email will be sent when the build begins, but after SCM polling has completed.

RegressionTrigger : An email will be sent any time there is a regression. A build is considered to regress whenever it has more failures than the previous build, or if there are new tests that failed.

ScriptTrigger : the build occurs. The last line of the script should resolve to true to send an email, or false to not send an email. There are four objects added to the model for the script to use to interact with the build. Example:

// the last line in the script should resolve to a boolean true or false 
// only send am email if the build failed and 'mickeymouse' had a commit
build.result.toString().equals('FAILURE') && build.hasParticipant(User.get('mickeymouse'))

SecondFailureTrigger : An email will be sent when the build fails twice in a row after a successful build.

StatusChangedTrigger : An email will be sent if the build status changes.

StillFailingTrigger : An email will be sent if the build status is "Failure" for two or more builds in a row.

StillUnstableTrigger : An email will be sent if the build status is "Unstable" for two or more builds in a row. A build is unstable if there are test failures, but all the build steps completed successfully.

SuccessTrigger : An email will be sent if the build status is "Successful". If the "Fixed" trigger is configured, and the previous build status was "Failure" or "Unstable", then the "Fixed" trigger will send an email instead.

UnstableTrigger : An email will be sent any time the build is unstable. A build is unstable if there are test failures, but all the build steps completed successfully. If the "Unstable - Still" trigger is configured, and the previous build status was "Unstable", then the "Unstable - Still" trigger will send an email instead.

XNthFailureTrigger : An email will be sent when the build fails X times in a row after a successful build.