I wanna deploy by git my application to the host. But if I push my code to repository, in the repo I do not have some of vendor modules (I added them by composer in my local test host). Is it something with .gitignore in vendor modules ? (Especially with zfc-twitter-bootstrap and zf-commons). What is the proper way or good practice to deploy by git my application and get submodule added in repo. (On gitweb a have: "Reading blob failed." in the place of module files). Thanks in advance guys.
Asked
Active
Viewed 619 times
0
-
This answer is what you're looking for: http://stackoverflow.com/questions/279169/deploy-a-project-using-git-push#327315 You only need to add a "composer install" command to your bash script (git post-recieve hook) – edigu Feb 05 '14 at 21:57
2 Answers
1
You should look at Capistrano
:
http://tfountain.co.uk/blog/2009/5/11/zend-framework-capistrano-deployment
Pushing binaries like vendors into Git is generally not a good practice.

Aurélien Thieriot
- 5,853
- 2
- 24
- 25
0
composer install
is the good way.
But don't forget to include composer.lock in your git repo.
A good explanation can be read here
And you could do a composer dump-autoload --optimize
for an optimal autoloader.

jmleroux
- 947
- 6
- 17
-
Ok.. so you guys think, that I should deploy my application using 'git push' to the host as it is (with ignored some of the modules from vendor) and fire composer install on my production server, am I right ? – dgierejkiewicz Feb 06 '14 at 14:01
-
If git is the only option, yes. (Capistrano is very good tool). You push a release tag on your repo, and you checkout this tag on production, then `composer install`. – jmleroux Feb 06 '14 at 14:05
-
All right.. great thanks for the advices, I'll try to test them. Host admin tried to fire composer install and got error 'Could not scan for classes inside'. That stopped us. – dgierejkiewicz Feb 06 '14 at 14:44
-
Ok. I've started using zfdeploy.phar (https://github.com/zfcampus/zf-deploy) It's really good stuff. Thanks for advices guys. – dgierejkiewicz May 26 '14 at 10:11