https://github.com/webgriffe/deployer-magento2
Deployer recipe for Magento 2 project
https://github.com/webgriffe/deployer-magento2
Last synced: 9 months ago
JSON representation
Deployer recipe for Magento 2 project
- Host: GitHub
- URL: https://github.com/webgriffe/deployer-magento2
- Owner: webgriffe
- License: mit
- Created: 2017-09-26T10:42:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-17T10:40:25.000Z (about 5 years ago)
- Last Synced: 2025-09-03T01:55:51.591Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Magento 2 Deployer Recipe
===========================
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`:
```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` 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`.
* The task `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');
```
* The task `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).
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 directory
* `magento:db-pull`: pulls database from the remote stage to local environment
* `magento: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:
```php
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®](http://www.webgriffe.com/). Please, report to us any bug or suggestion by GitHub issues.