jalogut / magento2-deployer-plus

Tool based on deployer.org to perform zero downtime deployments of Magento 2 projects
GNU General Public License v3.0
200 stars 59 forks source link

{{magento_bin}} ignores deployers {{bin/php}} setting #2

Closed renttek closed 6 years ago

renttek commented 6 years ago

Hi,

I was playing around with this project and ran into some errors on build machines with multiple versions of php installed.

TL;DR: {{magento_bin}} ignores deployers {{bin/php}} setting and executes the wrong php binary

The {{magento_bin}} command just executes the /bin/magneot command, which in turn uses the env command in the shebang to determine which php executable to use (#!/usr/bin/env php)

In deployer it is possible to set another php executable with set('bin/php', ...) like this:

set('bin/php', function () {
    return locateBinaryPath('php7.1');
});

The easiest fix would be to use "{{bin/php}}" to execute bin/magento.

To do this, in file recipe/magento_2_1.php change Line 27:

From:

set('magento_bin', '{{bin/php}} {{magento_dir}}/bin/magento');

To:

set('magento_bin', '{{magento_dir}}/bin/magento');
jalogut commented 6 years ago

@renttek thanks again. See my comment in the PR #3