I'm facing an issue where Jenkins keeps polling the repositories for changes, leading to a long queue of items. In our Multibranch Pipeline setup, we have the option turned on to run periodically unless triggered otherwise. I would like to know if there's a way to improve this by using GitLab webhooks so that Jenkins only gets notified upon each new commit. Any tips or best practices for setting this up would be very helpful. Thanks!
3 Answers
If you're set on using Jenkins, one approach is to implement best practices to reduce polling. Add jitter to your timers, and consider moving your evaluation logic to upstream jobs that kick off the builds. And definitely talk to your admin about setting up webhooks to streamline your process. It's a game changer!
It's kind of puzzling that you have GitLab but are sticking with Jenkins. Seems like a mismatch. Why not consider using GitLab Pipelines instead?
Exactly! Switching to GitLab Pipelines could save you lots of trouble.
While migrating to GitLab Pipelines is definitely worth considering, I know that can be a tough sell. Instead, focus on how to integrate GitLab webhooks with Jenkins. The GitLab documentation is a great resource for that; check out [this link](https://docs.gitlab.com/integration/jenkins/) for step-by-step guidance.

Great tips! Also, keeping your jobs lightweight and quick to fail can really help streamline things.