[英]Raise a notification in Jenkins Freestyle Project
I have a scenario where I call an external API through powershell, as part of the build steps.我有一个场景,作为构建步骤的一部分,我通过 powershell 调用外部 API。
The requirement is to raise a notification in a Jenkins freestyle project.要求是在 Jenkins 自由泳项目中发出通知。 Eg if the API replies with an error, I need to raise a warning, which will subsequently trigger a Teams notification.
例如,如果 API 回复错误,我需要发出警告,随后将触发 Teams 通知。
Is it possible to train a notification in a Jenkins freestyle project?是否可以在 Jenkins 自由泳项目中训练通知?
Build's failure/unstable state can be be notified to Teams.可以将构建的失败/不稳定 state 通知给团队。
When the API call returns an error, it needs to make the build state as failed/unstable.当 API 调用返回错误时,它需要将构建 state 设置为失败/不稳定。
When the API call returns an error, log an error/warning to the console log.当 API 调用返回错误时,将错误/警告记录到控制台日志中。 This error/warning can be detected using Log Parser and it can mark the build as failed/unstable.
可以使用Log Parser检测到此错误/警告,它可以将构建标记为失败/不稳定。 The build's failure/unstable state is then automatically notified to Teams.
然后会自动将构建的失败/不稳定 state 通知给 Teams。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.