我有两个Jenkins管道作业(例如job_1和job_2),在将Developer-Verified +1
发布到gerrit上时,将设置job_1进行触发,类似地,通过“ Code-Review +2”来触发job_2
。 / p>
这是要求:
req-1)已添加开发人员验证的+1:trigger job_1
req-2)代码审查+2:trigger job_2
req-3)开发人员验证的+1和代码审查的+2一起添加了:job_2 to wait for job_1 to finish then start the build.
是否可以使用jenkins管道实现此目的?
目前,我在job_1
上具有此触发配置,并且可以正常工作,job_1很简单,应该始终在开发人员验证的+1上触发,很简单:
triggers {
gerrit(
serverName: 'server-name',
gerritProjects: [[<list project and branch>]],
triggerOnEvents: [
commentAdded(commentAddedTriggerApprovalValue: '+1', verdictCategory: 'Developer-Verified')
]
)
}
在job_2上,我添加了dependencyJobsNames: "job_1"
,如下所示,当开发人员验证的+1和Code-Review +2一起添加时(如上面的req-3所示),job_2按预期方式等待job_1-好
但是,当仅添加Code-Review +2
时(如上述req-2),job-2会一直等待消息:
(pending—Waiting for all projects to finish gerrit-triggering to make sure no dependencies need to build first.)
,是否有解决方法?
triggers {
gerrit(
serverName: 'server-name',
gerritProjects: [[<list project and branch>]],
dependencyJobsNames: "job_1",
triggerOnEvents: [
commentAdded(commentAddedTriggerApprovalValue: '+2', verdictCategory: 'Code-Review')
]
)
}
更新:当添加代码审阅+2来触发job_2时(如上述req-2),这意味着已经添加了开发人员验证的+1,并且该gerrit的job-1已经完成。>