Combining Build triggers in Jenkins

二次信任 提交于 2019-12-11 12:34:08

问题


I have two build triggers (poll SCM and FStrigger-MonitorFiles) configured for a job, say the polling is scheduled for daily poll (@daily) , Now the build is triggered if poll SCM detects change or FStrigger-MonitorFiles does which is normal behavior.

But if both detects the change the build will be triggered twice as each triggers tries to trigger the build , how do i achieve combining the results of above two triggers daily and trigger/not trigger the build only once.


回答1:


You could create a special trigger job that is scheduled for both triggers. Inside this job by using system groovy script you could check if any build of the target job has been built today. Then according to the results of the check this job does or does not trigger the target job.



来源:https://stackoverflow.com/questions/22348897/combining-build-triggers-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!