承接 yvoronoy/m2install 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yvoronoy/m2install

Composer 安装命令:

composer require yvoronoy/m2install

包简介

Magento 2 Bash Install/Restore Script

README 文档

README

Docker Image CI GitHub closed pull requests GitHub closed issues

This script is designed to simplify the installation process of Magento 2 and rapid deployment of merchant code and DB dumps.

m2install can be a helpful tool for support teams and teams who often need to install or deploy merchant backups or dumps.

The main purpose of this script is run m2install, wait a bit and get a working magento instance. Don't waste time on routine operations.

If you have any issues please report them to https://github.com/yvoronoy/m2install/issues

What can m2install exactly do?

  • Can automatically restore backup files created by
  • php bin/magento setup:backup --code --db
  • Can automatically restore support dumps created by Enterpsie Support Tool
  • php bin/magento support:backup:code (db)
  • Script can automatically install vanilla magento

Installation

Download latest version by curl

curl -o m2install.sh https://raw.githubusercontent.com/yvoronoy/m2install/master/m2install.sh

You can install by composer

composer require yvoronoy/m2install

In case you are using bash completion you can download completion for this script.

#For Linux User
curl -o /etc/bash_completion.d/m2install-bash-completion https://raw.githubusercontent.com/yvoronoy/m2install/master/m2install-bash-completion

#For OSX User with brew
curl -o /usr/local/etc/bash_completion.d/m2install-bash-completion https://raw.githubusercontent.com/yvoronoy/m2install/master/m2install-bash-completion

Usage

$ m2install.sh --help
m2install.sh is designed to simplify the installation process of Magento 2
and deployment of client dumps created by Magento 2 Support Extension.

Usage: m2install.sh [options]
Options:
    -h, --help                           Get this help.
    -s, --source (git, composer)         Get source code.
    -f, --force                          Install/Restore without any confirmations.
    --sample-data (yes, no)              Install sample data.
    --ee                                 Install Enterprise Edition.
    --b2b                                Install B2B Extension.
    -v, --version                        Magento Version - it means: Composer version or GIT Branch
    --mode (dev, prod)                   Magento Mode. Dev mode does not generate static & di content.
    --quiet                              Quiet mode. Suppress output all commands
    --skip-post-deploy                   Skip the post deploy script if it is exist
    --step (restore_code,restore_db      Specify step through comma without spaces.
        configure_db,configure_files     - Example: m2install.sh --step restore_db,configure_db
        installB2B --b2b                 - Example: m2install.sh --step installB2B --b2b
        installLiveSearch)               - Example: m2install.sh --step installLiveSearch
    --restore-table                      Restore only the specific table from DB dumps
    --debug                              Enable debug mode
    --php                                Specify path to PHP CLI (php71 or /usr/bin/php71)
    --remote-db                          Remote database name
    --es-host, --elasticsearch-host      Set the Elasticsearch host
    --es-port, --elasticsearch-port      Set the Elasticsearch port
    --uninstall                          Delete database and application from the current folder
    _________________________________________________________________________________________________
    --ee-path (/path/to/ee)              (DEPRECATED use --ee flag) Path to Enterprise Edition.

How to deploy backup/support dumps

In order to deploy the customer dumps you need:

  • Put DB and code dumps to new directory
  • Go to directory and run m2install

How to install Magento 2 using GIT

To install Magento 2 from git repository run m2install with --source git param

  • m2install --source git or
  • m2install -s git

How to install Magento 2 using Composer

To install Magento 2 from composer run m2install with --source composer param

  • m2install --source composer or
  • m2install -s composer

How to Install Magento 2 with Sample Data

  • Run m2install
  • Use wizard to install the sample data.

How to Install Magento 2 with B2B extension

With wizard

  • Run m2install
  • Use wizard to install the B2B

With CLI flags

  • m2install --ee --b2b or
  • m2install --step installB2B --b2b if you already have Magento EE

Remember that you have to install Enterprise Edition to be able to install B2B extension

Wizard

m2install shows you wizard on first run and prompts to save entered values to config file.

$ m2install.sh 
Current Directory: /Users/yvoronoy/Sites/m2/ee202
Configuration loaded from:
Enter Server Name of Document Root (default: http://mage2.dev/): 
Enter Base Path (default: ee202): 
Enter DB Host (default: localhost): 
Enter DB User (default: root): 
Enter DB Password: 
Enter DB Name (default: root_ee202): 
Do you want to install Sample Data (y/N) n
Enter Path to EE or [nN] to skip EE installation: n
--------------------------------------------------
BASE URL: http://mage2.dev/ee202/
DB PARAM: root@localhost
DB NAME: root_ee202
Sample Data will NOT be installed.
Magento EE will NOT be installed.
In order to generate static/di content, add mode param: m2install.sh --mode prod
Are you sure? [y/N] 

How to use configuration files

The config file allows you to store params for DB and URL. Example of config file

HTTP_HOST=http://your-mage-host.com/
BASE_PATH=your/base/path/${CURRENT_DIR_NAME}
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=dbpassword

When you first run m2install script, it shows wizard which prompts to save the config file to your home directory.

m2install uses fallback mechanism to find config files recursively from home directory to current directory. For example if you want to install magento to directory ~/www/m2/ga/magento2ee

you can override config file which is placed in your home directory.

~/.m2install.conf
~/www/.m2install.conf
~/www/m2/.m2install.conf
~/www/m2/ga/.m2install.conf
~/www/m2/ga/magento2ee/.m2install.conf

How to use ssh tunnels for remote DB connection

Make sure that you have correct parameters in .m2install.conf file Parameters example:

REMOTE_DB_HOST=mysql-host:3306
REMOTE_HOST=user@ssh.domain
REMOTE_KEY=/Users/path/to/ssh_key
LOCAL_PORT=33060

As a result you will get:

ssh -i /Users/path/to/ssh_key -o StrictHostKeyChecking=no -4fN -L 33060:mysql-host:3306 user@ssh.domain >> /dev/null

All created ssh tunnels pids located in file kill_tunnel.sh in Magento root folder (or pub)

To run you will need only code dump file (Example code.tar.gz).

m2install.sh --remote-db database_name

Make attention that in --remote-db database_name first part before "_" is database user name

Make attention that in bootstrap added SECURE and UNSECURE BASE_URL to prevent DB modification

$_ENV['CONFIG__DEFAULT__WEB__UNSECURE__BASE_URL'] = 'http://magento.local/';

yvoronoy/m2install 适用场景与选型建议

yvoronoy/m2install 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 271 次下载、GitHub Stars 达 81, 最近一次更新时间为 2016 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 yvoronoy/m2install 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 yvoronoy/m2install 我们能提供哪些服务?
定制开发 / 二次开发

基于 yvoronoy/m2install 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 271
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 81
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 81
  • Watchers: 10
  • Forks: 44
  • 开发语言: Shell

其他信息

  • 授权协议: GNU
  • 更新时间: 2016-06-14