Skip to content

Commit

Permalink
Merge pull request #11 from philippsander/master
Browse files Browse the repository at this point in the history
Be able to change php version
  • Loading branch information
philippsander authored Nov 28, 2019
2 parents 061cff6 + e6905ea commit 3a64b5d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 4.4.0

- lets you use a different php version by using `putenv('PHP_BIN=/path/to/your/php')`

## 4.3.0

- add task to stop and start the cron daemon (optional)
Expand Down
1 change: 1 addition & 0 deletions src/Deployer/Recipe/N98Magento2Recipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static function configuration()
\Deployer\set('webserver_group', 'www-data');

\Deployer\set('phpfpm_service', 'php7.0-fpm');
\Deployer\set('php_bin', getenv('PHP_BIN') ?: 'php');
\Deployer\set('nginx_service', 'nginx');
\Deployer\set('cron_service', 'cron');
}
Expand Down
18 changes: 9 additions & 9 deletions src/Deployer/Task/MagentoTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function toggleMaintenenceMode($enabled)
$maintenance = $enabled === true ? 'maintenance:enable' : 'maintenance:disable';

\Deployer\cd('{{release_path_app}}');
\Deployer\run("php bin/magento $maintenance");
\Deployer\run(\Deployer\get('php_bin') . " bin/magento $maintenance");
}

/**
Expand All @@ -123,7 +123,7 @@ public static function allowSymlinks()
public static function runSetupUpgrade()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run('php bin/magento setup:upgrade --keep-generated');
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento setup:upgrade --keep-generated');
}

/**
Expand Down Expand Up @@ -162,7 +162,7 @@ public static function updateMagentoConfig()
}

\Deployer\cd('{{release_path_app}}');
\Deployer\run("php bin/magento config:data:import $dir $env");
\Deployer\run(\Deployer\get('php_bin') . " bin/magento config:data:import $dir $env");
}

/**
Expand All @@ -180,7 +180,7 @@ public static function updateMagentoConfig()
public static function backupMagentoConfig()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run('php bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/');
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento config:data:export --filePerNameSpace=y --format=yaml --filename=config_backup/');
}

/**
Expand All @@ -189,7 +189,7 @@ public static function backupMagentoConfig()
public static function importCmsData()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run('php bin/magento cms:import');
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento cms:import');
}

/**
Expand All @@ -200,7 +200,7 @@ public static function activateMagentoCache($enabled)
$cache = $enabled === true ? 'cache:enable' : 'cache:disable';

\Deployer\cd('{{release_path_app}}');
\Deployer\run("php bin/magento $cache");
\Deployer\run(\Deployer\get('php_bin') . " bin/magento $cache");
}

/**
Expand All @@ -209,7 +209,7 @@ public static function activateMagentoCache($enabled)
public static function disableMagentoFPC()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run("php bin/magento cache:disable full_page");
\Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:disable full_page");
}

/**
Expand All @@ -218,7 +218,7 @@ public static function disableMagentoFPC()
public static function clearMagentoConfigCache()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run("php bin/magento cache:clear config");
\Deployer\run(\Deployer\get('php_bin') . " bin/magento cache:clear config");
}

/**
Expand All @@ -227,7 +227,7 @@ public static function clearMagentoConfigCache()
public static function flushMagentoCache()
{
\Deployer\cd('{{release_path_app}}');
\Deployer\run('php bin/magento cache:flush');
\Deployer\run(\Deployer\get('php_bin') . ' bin/magento cache:flush');
}

/**
Expand Down

0 comments on commit 3a64b5d

Please sign in to comment.