Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reuse one Jenkins jobs for multiple Git (GitHub) repositories

I have a very simple Jenkins build which is needed for several repositories. All these repositories have the same organisation, the same branches, etc. There is no difference except the repository name.

Each single repository should be able to trigger the build for only this specific repository. I imagine something like combining a parameterized build with a WebHook URL containing a query parameter for the repository name maybe.

Any ideas or pointers about that?

like image 852
Guite Avatar asked Nov 18 '22 02:11

Guite


1 Answers

I know this question is already answered, but there is another simple way of triggering a single Job from multiple GitHub URLs.

You could use Generic Webhook Trigger Plugin to build same Job from different GitHub repositories. You need to assign unique token to the Job and configure the Webhook of multiple GitHub repositories as:

JENKINS_URL/generic-webhook-trigger/invoke?token=TOKEN_NAME

like image 166
pppai Avatar answered Dec 23 '22 13:12

pppai