davidalger / capistrano-magento2

Magento 2 specific tasks for Capistrano 3
https://rubygems.org/gems/capistrano-magento2
Open Software License 3.0
228 stars 75 forks source link

Change default path of Composer #152

Closed dverkade closed 4 years ago

dverkade commented 4 years ago

Is there a way to change the default path of Composer? I'm setting set :composer, '/usr/local/php73/bin/php73 /usr/local/bin/composer' in my deploy.rb file, but it does not look like that is being picked up.

davidalger commented 4 years ago

I think what you're looking for is the command map functionality in SSH Kit: https://github.com/capistrano/sshkit#the-command-map

An example of it being used can actually be found in this gem's code to set the command used whenever execute :magento is called:

SSHKit.config.command_map[:magento] = "/usr/bin/env php -f bin/magento --"

Reference: https://github.com/davidalger/capistrano-magento2/blob/master/lib/capistrano/magento2.rb#L12

I believe that by default SSH Kit will use something like /usr/bin/env <command> respecting the $PATH (which may be different in the Capistrano context compared to the login shell one gets when SSH'ing in with a prompt)

HTH!

dverkade commented 4 years ago

Thanks @davidalger , that did the trick!