Running a Post Build script when a Jenkins job is aborted

后端 未结 4 1756
执笔经年
执笔经年 2021-02-07 02:23

Is there a possible way / plugin that can run a post build script when a Jenkins job is aborted. I do see that the post build plugin provides an action to execute a set of scrip

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 02:41

    As far as I know, if a build is aborted, there's no way to execute any build steps (or post build steps) in it any more - which makes sense, that's what I would expect of "abort".

    What you could do is create another job that monitors the first one's status, and triggers if it was aborted (e.g. see the BuildResultTrigger plugin).

    Another solution might be to create a "wrapper" job, which calls the first one as a build step - this way you can execute additional steps after its completion, like checking its status, even if it was aborted.

提交回复
热议问题