How should git submodules be installed for laravel 4 composer packages?

I am building an application with laravel 4 and I am looking to deploy to a cloud server for further testing. Usually I usually do local> push to github> clone to server.

The problem is that almost all the laravel / composer packages that I added are ignored because they have their own git repositories. I did not think about this in advance.

I understand the concept of submodules, but I don’t quite understand how to configure them. Should I add a submodule in the parent tree for each package that I install in the application? Is there a more automated way to handle this?

Or am I completely off, and should they be updated on the server using the composer?

+4
source share
3 answers

It seems that the answer is composer: http://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md

add / sell the .gitignore file and start composer installation after the first clone.

+3
source

When using Composer, you don’t have to worry about Git submodules at all.

On your local machine, you simply list your dependencies in your composer.json , and then run composer install . Now add composer.json and composer.lock to the project repository, but exclude the vendor directory in .gitignore .

Now, to deploy your project, simply clone or pull the project repository to your production server, and then run composer install again to install all the project dependencies.

When you make changes to your dependencies, you perform the same process again, including composer install on your local and production machines.

+1
source

I think this is a serious mistake to run the composer on a production server. See Getting Started with a Chef and Installing a Linker During Deployment

+1
source

All Articles