robertobatts
robertobatts

Reputation: 967

Jenkins: trigger the same job from different BitBucket repositories

I have 50+ repositories in a BitBucket project and I want them to execute the same job when a commit is pushed (that is maven build and deploy to artifactory). I tried to create a Maven job and make it work, but that can be linked to only one repository. I also tried installing the Bitbucket Team plugin and creating a project with it, and I think this could lead to a solution. In fact I saw that it scans automatically all the repositories with a JenkinsFile in it, so I thought that I could create a common Pipeline on jenkins and call this pipeline from every JenkinsFile in every repository. The problem is that I still have to create a JenkinsFile for each repository, and I don't want to do that. Is there anyway that I can trigger the same Jenkins job from all my repositories?

Upvotes: 1

Views: 736

Answers (2)

Aytunc Beken
Aytunc Beken

Reputation: 111

You can use Remote File Plugin for this. What you need to do is,

  • Create a separate repository and put your Jenkins file into it.
  • Define this repository and Jenkins file in the Remote File section of the BitBucket Team Project configuration page.

This way, for every repository in your BitBucket, this Jenkins file will be run.

Hope this helps.

You can find the example screenshot below.

enter image description here

You can find it under Project Recognizers

enter image description here

Upvotes: 1

Aytunc Beken
Aytunc Beken

Reputation: 111

It is under the Project Recognizers

enter image description here

Upvotes: 0

Related Questions