webgriffe / deployer-magento2
Deployer recipe for Magento 2 project
Installs: 9 719
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 1
Open Issues: 1
This package is auto-updated.
Last update: 2024-08-17 18:23:02 UTC
README
Deployer recipe for Magento 2 project. This adds some useful tasks for db and media operations and it overrides some
Install
Install it using Composer:
$ composer require --dev webgriffe/deployer-magento2 dev-master
Usage
Require the recipe in your deploy.php
:
namespace Deployer; require __DIR__ . '/vendor/webgriffe/deployer-magento2/magento.php'; // ... usual Deployer configuration
This recipe overrides some tasks of the original Deployer Magento2 recipe:
- The tasks
deploy:magento
anddeploy
now do not enable and disable the maintenance page. Instead, if you want to do that you must use one of two new tasksdeploy:magento-maintenance
anddeploy-maintenance
. - The task
magento:deploy:assets
now uses theassets_locales
environment variable that you can define in your deploy.php file like this:set('assets_locales', 'en_GB en_US it_IT');
- The task
deploy:resetOPCache
called insidedeploy
anddeploy:maintenance
uses variable base_url that you can define in your deploy.php file like this:server('staging', 'my.server.com') ->user('myUser') ->set('deploy_path', '/path/to/public_html') ->set('http_user', 'myUser') ->set('http_group', 'myGroup') ->set('base_url', 'http://myBaseUrl.com/') ->stage('staging');
It also adds the magento:first-deploy
task which is useful when depoying a project for the first time (when Magento is not installed).
Magento useful tasks
This recipe provides some Magento's related tasks:
magento:db-dump
: creates a gzipped database dump on the remote stage in the deploy user's home directorymagento:db-pull
: pulls database from the remote stage to local environmentmagento:media-pull
: pulls Magento media from the remote stage to local environment-
With the
media_pull_exclude_dirs
environment variable it's possible to specify which sub-directories of the media dir you want to exclude. Usage example:add('media_pull_exclude_dirs', ['wysiwyg']);
-
You can specify the execution timeout for this task by using the
media-pull-timeout
argument while running the command. This is needed because the default execution's time for the tasks on deployer is of 300s and when you first run this command it could take a while if the media directory is big (or maybe after a huge import). Usage example:dep magento:media-pull --media-pull-timeout 900
-
License
This library is under the MIT license. See the complete license in the LICENSE file.
Credits
Developed by Webgriffe®. Please, report to us any bug or suggestion by GitHub issues.