如果今天有另一份工作至少执行一次,请运行詹金斯的工作
我想设置一个每天晚上运行的Jenkins作业(我们称之为A),并检查是否另一个Jenkins作业(我们称之为B)今天至少成功运行了一次.我不希望B触发A,因为B每天可能运行多次,但是我希望A仅运行一次-如果B不运行,则根本不运行.
I want to set up a Jenkins job (let's call it A) that would run nightly and check if another Jenkins job (let's call it B) ran successfully at least once today. I don't want B to trigger A because B may run multiple times per day, but I want A to run only once--and not to run at all if B did not run.
我考虑过使用条件步骤"选项,但是我不确定如何配置条件.我知道检查另一个作业的构建时间戳的唯一方法是通过Jenkins restful API,但是如果我通过shell中的curl命令执行此操作,则必须公开Jenkins用户的密码,而我不想这样做(更不用说必须在shell中解析json输出了,我也宁愿避免这样做).
I thought of using the "Conditional step" option, but I'm not sure how to configure the condition. The only way I know of to examine the timestamps for another job's builds is via Jenkins restful API, but if I do it via curl commands in shell, I'd have to expose the Jenkins user's password, which I don't want to do (not to mention having to parse the json output in shell, which I would also rather avoid doing).
有什么建议吗?