在构建中止时优雅地停止构建步骤(插件) [英] Gracefully stopping a build step (plugin) on build abort

查看:123
本文介绍了在构建中止时优雅地停止构建步骤(插件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Jenkins中有一个插件,可以通过rest操作远程服务器.
如何在构建中止时向服务器发送最后一个请求?这样,可以优雅地完成插件的工作了吗?

I have a plugin in Jenkins that operates a remote server via rest.
How can I send one last request to the server on build abort? Thus, gracefully finishing the work of the plugin?

我发现的唯一关于中止序列"的参考是. 这使我认为该过程非常繁琐,并且在终止子进程(我的插件)之前无法捕捉到信号.

The only reference to the 'Abort sequence' that I found is this. Which makes me think that the procedure is very rough, and that I can't catch the signal before it terminates the child (my plugin).

推荐答案

我也有类似的需求,我用

I have a similar need, which I solved with the PostBuildScript Plugin.

我选择运行构建步骤,但是您可以运行其他几个选项.很好用. 无论构建如何结束(成功,失败或中止),我都有一个必须运行的脚本.对我来说很棒.

I choose to run a build step, but you can run several other options. Very easy to use. I have a script I must run regardless of how the build ended (success, fail or abort). It works great for me.

我希望这会有所帮助.

这篇关于在构建中止时优雅地停止构建步骤(插件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆