仅当另一个作业的最后执行成功时才触发 Hudson 中的定期作业
我有一项工作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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 Hudson Join 插件 这是为这种场景而设计的(等待一个作业结束后再执行另一个作业)。
最终结果与您已经在做的事情不会有太大不同,但这将被巧妙地参数化:
所以您仍然需要检查
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:
So you would still have to check the status of
FOO
job, but at least you would check it right afterFOO
job completion.