24/07
2018
Wallogit.com
2017 © Pedro PelĂĄez
Deployer recipe for Magento 2 project
Deployer recipe for Magento 2 project. This adds some useful tasks for db and media operations and it overrides some, (*1)
Install it using Composer:, (*2)
$ composer require --dev webgriffe/deployer-magento2 dev-master
Require the recipe in your deploy.php:, (*3)
namespace Deployer; require __DIR__ . '/vendor/webgriffe/deployer-magento2/magento.php'; // ... usual Deployer configuration
This recipe overrides some tasks of the original Deployer Magento2 recipe:, (*4)
deploy:magento and deploy now do not enable and disable the maintenance page. Instead, if you want to do that you must use one of two new tasks deploy:magento-maintenance and deploy-maintenance.magento:deploy:assets now uses the assets_locales environment variable that you can define in your deploy.php file like this:
php
set('assets_locales', 'en_GB en_US it_IT');
deploy:resetOPCache called inside deploy and deploy:maintenance uses variable base_url that you can define in your deploy.php file like this:
php
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).This recipe provides some Magento's related tasks:, (*5)
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, (*6)
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']);
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
This library is under the MIT license. See the complete license in the LICENSE file., (*7)
Developed by WebgriffeÂź. Please, report to us any bug or suggestion by GitHub issues., (*8)