rafaelstz/deployer-magemojo

MageMojo Stratus 部署器配方

1.1.0 2021-07-09 13:35 UTC

This package is auto-updated.

Last update: 2024-09-23 17:00:18 UTC


README


Magemojo Stratus Deployer Recipe

在部署中轻松运行缓存清除

Build Status Tags Total Downloads

使用此工具与Deployer集成,利用MageMojo Stratus CLI的强大功能。

如果您正在使用 Magento 2,可以与这个Magento 2 部署器配方一起使用!

功能

您可以在命令后跟 dep。例如: dep mm:cache:clear --stage=production

如何安装

如何安装 Deployer

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

如何安装此包

composer require rafaelstz/deployer-magemojo --dev

如何使用

安装后,您可以在 namespace 之后添加以下行并运行 dep 进行检查

// MageMojo Recipe
require __DIR__ . '/vendor/rafaelstz/deployer-magemojo/MageMojo.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');

例如

<?php

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

// Project
set('application', 'My Project Name');
set('repository', 'git@bitbucket.org:mycompany/my-project.git');
set('default_stage', 'production');

// Project Configurations
host('production')
    ->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');

许可证

MIT

Rafael Correa Gomes