仅当另一个作业的最后执行成功时才触发 Hudson 中的定期作业

发布于 2024-09-24 01:14:30 字数 442 浏览 0 评论 0原文

我有一项工作NIGHTLY,每晚由定期计时器运行一次。
现在我想进行更改,以便仅当 Hudson 中另一个作业 FOO 的最后一次执行成功时才运行 NIGHTLY 作业。

注意:

  • 作业 FOO 每天运行多次,并由 SCM 触发。
  • NIGHTLY 只能每晚在特定时间运行一次。

目前,我有另一项作业 NIGHTLY_TRIGGER,它运行一个 bash 脚本,该脚本访问作业 FOO 的远程 API,以检查作业 FOO 是否成功以及是否成功触发 NIGHTLY 作业。

有没有更好/更干净的方法来做到这一点? (最好使用一些 Hudson 插件)

I have a job NIGHTLY that runs one time each night by a periodical timer.
Now I want to change so that the NIGHTLY job is only run if the last execution of another job FOO in Hudson is successful.

Note:

  • Job FOO is run many times each day and is triggered by SCM.
  • NIGHTLY should only be run one time per night and at a specific time.

Currently I have another job NIGHTLY_TRIGGER that runs a bash script that access the remote API of job FOO to check if job FOO is successful and if so triggers the NIGHTLY job.

Are there a nicer/cleaner way to do this? (preferable by using some Hudson plugins)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上的星空 2024-10-01 01:14:30

您可以查看 Hudson Join 插件 这是为这种场景而设计的(等待一个作业结束后再执行另一个作业)。
最终结果与您已经在做的事情不会有太大不同,但这将被巧妙地参数化:

alt text

所以您仍然需要检查 FOO 作业的状态,但至少您会在 FOO 作业完成后立即检查它。

You could check out the Hudson Join Plugin which is made for this kind of scenario (wait for the conclusion of a job before executing another one).
The end result wouldn't be much different from what you are already doing, but this would be neatly parameterized:

alt text

So you would still have to check the status of FOO job, but at least you would check it right after FOO job completion.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文