capifony icon indicating copy to clipboard operation
capifony copied to clipboard

Changed the way to copy composer's vendors

Open pimolo opened this issue 10 years ago • 3 comments

Currently, here is the way Capifony copies dependencies in a new release :

run "vendorDir=#{current_path}/vendor; if [ -d $vendorDir ] || [ -h $vendorDir ]; then cp -a $vendorDir #{latest_release}/vendor; fi;"

It works pretty fine except for one case : if I decide to not sharing vendors anymore (by adding vendor/ in :shared_children) copying these (setting :copy_vendors to true), while I have already deployed at least one release with the first configuration. In this case, my current release contains a symlink that points on shared/vendor/. Now, if I want to copy the dependencies and not sharing them to all releases, I will change my configuration like above. Ok, but when I'll deploy my app, Capifony will copy the symlink of the current release into the new release, and composer install will actually occurs into the shared folder. This is the behaviour we have when sharing vendors. And all this causes known issues with rollback fails, downtimes on deployments... (IMO this is why sharing vendors is a very bad practise, and this deserves its place in the doc) So changing my configuration is not enough in this case. I want to copy the content of the vendor/ folder, not the symlink itself. This pull request suggest exactly that behaviour. It should break nothing for current users of this feature.

pimolo avatar Sep 17 '15 15:09 pimolo

I want to thank @rjmunro for this idea https://github.com/everzet/capifony/pull/274#commitcomment-3881589 :)

pimolo avatar Sep 17 '15 15:09 pimolo

@everzet Can this be merged?

rjmunro avatar May 04 '16 10:05 rjmunro

Omg, they are the same !

youngpimo

Nek- avatar May 04 '16 12:05 Nek-