3

I've been looking around to see how to have ~10 different repos all on a git push trigger a single pipeline that does pretty much the same exact thing - build a docker image -except that the different repo names will be used for the docker image repo and the specific git commit will be the tag.

Is this possible or do I have to break it down into multiple pipelines? Ideally I would be able to have one that queues jobs when multiple pushes happen in a short period of time.

2 Answers 2

1

I would be inclined to use Pipeline Templating as this gives you the ability to define standard templates centrally but leave the SCM field to be defined by the individual job.

Leveraging templates in this way lets you separate the business logic (what should happen when) of your pipeline from the technical implementation (what’s actually going to happen). The result of this is a CI/CD pipeline that’s proven to be significantly easier to manage when supporting multiple teams simultaneously.

I recommend that you do not have a single pipeline for all repositories as that is going to make it very hard to tell which repository is failing or slow via dashboards and alerts.

0

I use Pipeline Shared Libraries to share a single build pipeline across roughly 180 different repositories.

The pipeline itself is defined in a function in the shared library, and the Jenkinsfile for all of the repos is just a one-liner that calls that function.

There's also an example of how to share a build pipeline using shared libraries in an official Jenkins blog post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.