An open API service indexing awesome lists of open source software.

https://github.com/rafaelstz/deployer-magemojo

With this MageMojo Stratus Deployer Recipe you can use the MageMojo's CLI power
https://github.com/rafaelstz/deployer-magemojo

cli deploy deployer hosting magento

Last synced: about 2 months ago
JSON representation

With this MageMojo Stratus Deployer Recipe you can use the MageMojo's CLI power

Awesome Lists containing this project

README

        




Magemojo Stratus Deployer Recipe




Easily run cache clearing in your deployments


Build Status
Tags
Total Downloads



Use this tool integrated with the [Deployer](https://deployer.org/) to use the power of [MageMojo Stratus CLI](https://magemojo.com/kb/knowledge-base/stratus-cli/).

If you are using Magento 2 you can use this [Magento 2 Deployer Recipe](https://github.com/rafaelstz/deployer-magento2) together!

Features
-----

You can run the command followed by **dep**. Example: `dep mm:cache:clear --stage=production`.

| Command | Description |
|----------|-------------|
| mm:cron:stop | Stop Crons from running |
| mm:cron:start | Start crons |
| mm:zdd:init | Zero Downtime Deployment Init |
| mm:zdd:switch | Zero Downtime Deployment Switch with check |
| mm:autoscaling:reinit | It will issue a redeploy of PHP-FPM services |
| mm:cache:clear | Clears everything |
| mm:cloudfront:clear | Clears Cloudfront cache |
| mm:opcache:clear | Clears OPCache cache |
| mm:redis:clear | Clears Redis cache |
| mm:varnish:clear | Clears Varnish cache |

How to install
-------

How to install Deployer:

```
curl -LO https://deployer.org/deployer.phar && sudo mv deployer.phar /usr/local/bin/dep && sudo chmod +x /usr/local/bin/dep
```

How to install this package:

```
composer require rafaelstz/deployer-magemojo --dev
```

How to use
-----

After install it, you can add the line below after the **namespace** and run `dep` to check:

```php
// MageMojo Recipe
require __DIR__ . '/vendor/rafaelstz/deployer-magemojo/MageMojo.php';
```

This recipe when installed automatically will clean all caches after the deploy success, but if you want to restart all services, add these into the bottom:

```php
// MageMojo restart services
before('deploy', 'mm:cron:stop');
after('deploy', 'mm:cron:start');
after('success', 'mm:autoscaling:reinit');

// MageMojo clean all caches
after('success', 'mm:cloudfront:clear');
after('success', 'mm:varnish:clear');
after('success', 'mm:redis:clear');
```

For example:
-----

```php
hostname('iuse.magemojo.com')
->user('my-user')
->port(22)
->set('deploy_path', '/home/my-project-folder')
->set('branch', 'master')
->stage('production');

// MageMojo restart services
after('success', 'mm:autoscaling:reinit');

// MageMojo clean all caches
after('success', 'mm:cloudfront:clear');
after('success', 'mm:varnish:clear');
after('success', 'mm:redis:clear');

```

License
-----

MIT

[Rafael Correa Gomes](https://www.linkedin.com/in/rafaelcgstz/)