Jenkins builds being triggered despite “Don't trigger a build on commit notifications”

…衆ロ難τιáo~ 提交于 2019-12-06 10:43:44

After some exchange with the Jenkins mailing list, I now understand better how things work so here is what I had to do in case other people need it:

  • Create a git hook to notify Jenkins that changes have been committed/pushed: on our end we created a post-receive hook on the remote
  • Enable polling on your job but leave the schedule empty
  • In the Pipeline section, configure it to pull the groovy script from your git repo (in my example it is repoB) but don't add the behavior: "Don't trigger a build on commit notifications"
  • Make sure polling is enabled when you checkout your git repository (in my example it is repoA) in your script: by default it is enabled if you don't specify it

As far as I understand, the option "Don't trigger a build on commit notifications" is for notifications comming from the hooks and not from the job polling schedule as I first thought.

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