Symfony2 - Manage multiple versions of bundles efficiently

158 views Asked by At

My team and I are developing a back office with Symfony2 that manages multiple apps. Right now we only have one app but in the near future, we should be able to manage lots of them.

We decided to develop each component (aka app) in a separate bundle.

What we want is to be able to deploy the whole symfony2 project without to worry (too much) about side effects between components.

In deed, ideally, we'd like to be able to deploy version X of component A and version Y of component B when we deploy the whole project.

In order to do so, here are the options we explored :

  • 1) Bundles are git submodules
  • 2) Bundles are in separates repositories and managed in the main composer.json of the project

The first one seems legit but I'm not sure this is a good practice : what do you think?

The second one looks the right way to handle dependencies (and versioning) but very bad in terms of productivity as we have to push the last version of the bundle repository, then update composer, before finally being able to test the bundle in the main project.

I know this is an open question but what I'd like to have is some feedback about the good practices in this case.

1

There are 1 answers

0
Justin Howard On BEST ANSWER

Git submodules are annoying because of the large amount of micromanagement required to keep them updated. I'd go with option 2.

You can massively improve your workflow with composer by using the --prefer-source flag when installing.

composer install --prefer-source

This will install your dependencies by cloning their repositories into the vendor directory. You can then work on your component and commit to it directly from your project.

# You can make modifications to your component here
cd vendor/vendorName/componentA
git commit # Commit to your changes to the component repository