1

I have a composer.json file which contains a number of dependencies as Git repositories. I have a Jenkins server running on AWS. Now what I actually want is to trigger Jenkins Pipeline whenever a pull request is merged in any of those dependencies defined in composer.json file.

Should I have to create a trigger in each repo's settings or is there a better way? Suggestions will be appreciable.

Thanks

2
  • Do all the repositories belong to you or are 3rd party? Commented Apr 17, 2017 at 9:59
  • All the repositories are part of the same account. Commented Apr 17, 2017 at 10:03

1 Answer 1

1

I would use Jenkins to trigger. Everytime a submodule or package is changed via SCM, you trigger after the build the main project.

  • Every repository has its own jenkins job.
  • Each has an SCM trigger and listens to changes.
  • Every job in the composer.json - not the main project - has a downstrem post build trigger to run the main project job.
  • when the main project is triggered it runs composer update to get all new versions and runs itself with the new lib version
Sign up to request clarification or add additional context in comments.

7 Comments

You mean, you would configure Jenkins to check for updated modules periodically, right?
via SCM change trigger every minute
But how does it will look for change through all the repositories and trigger the build?
It does not look for changes in all reps. Every rep looks for itself an tells the main project. 1. You change a lib you use in your main project. 2. Jenkins hears on SCM change and runs 3. Jenkins triggers main job 4. main jobs runs composer update and starts job with the new lib
That's sounds good. So proably if main project is updated through a sub-repo in composer.json file, we can also setup a Jenkins trigger there too. But how do every repo will tell the main project if one of them changes?
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.