每2小时触发一次Jenkins构建,但仅在有git commit时触发 [英] Trigger Jenkins build every 2 hours but only if there was a git commit
问题描述
这是我遇到的问题-我需要每2小时触发一次作业构建,但前提是有git commit(如果没有活动,则跳过). 我可以单独解决它们,但不确定如何一起解决-有人有什么好主意吗? 我唯一能想到的是一个cron作业,该作业每2小时检查一次,并且在此期间是否有git commit,请手动触发作业,但这看起来并不那么优雅.
Here is the problem that I am having - I need to trigger a job build every 2 hours but only if there was a git commit(skip if there was no activity). I can solve them individually but not sure how to solve them together - anybody has any good ideas? The only one I can come up with is a cron job that would check every 2 hours and if there is a git commit during that time, trigger a job manually, but that does not look all that elegant.
感谢任何好的想法.
推荐答案
将詹金斯设置为每2小时(0 */2 * * *)或类似时间使用轮询SCM"触发器
Set jenkins up to use the "Poll SCM" trigger every 2 hours (0 */2 * * *) or something like that
它将从git更新,如果有更改,将触发构建.
It'll update from git and, if there was a change, trigger a build.
这篇关于每2小时触发一次Jenkins构建,但仅在有git commit时触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!