GitHub, composer, autoupdate of standalone repositories

188 views Asked by At

I have a main repository which is core router for mine system modules.

So every module is a standalone repository also.

How can I make that pushing to main repository will fire event to push the updated code to standalone repository?

Just as like https://github.com/Sylius/Sylius - they have main repository (this link) in which they collect pull-requests and standalone repositories like https://github.com/Sylius/SyliusTaxonomyBundle which exists in src/Sylius/Bundle/TaxonomyBundle

Don't they manually push the updates to standalone repos? Or some kind of github hooks? git subtree?

And why they do have the "replace" section in composer.json? How does this works? I didn't get an idea from official documentation :((

1

There are 1 answers

0
Waaghals On BEST ANSWER

Sylius (and Symfony) create separate repositories for their components and bundle so that they can be used independently with composer. They only work in a single repository and use subtree to split the components and bundle into read only repositories.

I don't believe they are technically read-only, this is just an easier workflow than having to pull changes from the subrepo's in every time.

They probably use something like Git Subsplit GitHub WebHook to automatically update the subrepo's.


Using they replace key means that Sylius/Sylius contains Sylius/SyliusCartBundle in its self. So when using a project which uses Sylius/Sylius and Sylius/SyliusCartBundle, Composer knows not to download Sylius/SyliusCartBundle because it is already provided by Sylius/Sylius.