定制 terminal42/mage-tools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

terminal42/mage-tools

Composer 安装命令:

composer require terminal42/mage-tools

包简介

Magephp tools for easier deployment of Contao and Symfony systems.

README 文档

README

A set of predefined tasks and helpful libraries for the Magallanes PHP Deployment Tool.

Most of the tasks were created to ease the deployment of Symfony and Contao applications. Check the list below for a full list of available tasks and their configurations.

Usage

To use the tasks simply added them to your .mage.yml file. The recommended setup is:

pre-deploy:
    - 'Terminal42\MageTools\Task\IntegrityCheck\ContaoTask'
on-deploy:
    # ... symlinks, composer install ...
    - 'Terminal42\MageTools\Task\Symfony\PlatformReleaseTask'
    # ... symfony cache warmup, symfony assets install ...
    - 'Terminal42\MageTools\Task\Maintenance\LockTask'
on-release:
    - 'Terminal42\MageTools\Task\Symfony\AcceleratorCacheClearTask'
post-release:
    - 'Terminal42\MageTools\Task\Backup\DatabaseBackupTask'
    - 'Terminal42\MageTools\Task\Doctrine\MigrateTask'
    - 'Terminal42\MageTools\Task\Doctrine\CacheClearTask'
    # ... symfony cache clear ...
    - 'Terminal42\MageTools\Task\Maintenance\UnlockTask'

Available tasks

Terminal42\MageTools\Task\Symfony\AcceleratorCacheClearTask

Clears the accelerator cache. The AcceleratorCacheBundle is required for this to work.

on-release:
    - 'Terminal42\MageTools\Task\Symfony\AcceleratorCacheClearTask': { flags: "--opcode" }
Terminal42\MageTools\Task\Symfony\PlatformReleaseTask

Updates the platform version in the parameters.yml file. Uses git describe to fetch the version internally and adds the output as platform_version to your parameters.yml.

on-deploy:
    - 'Terminal42\MageTools\Task\Symfony\PlatformReleaseTask'

Backup

Terminal42\MageTools\Task\Backup\DatabaseBackupTask

Runs the database backup task using backup-manager/symfony bundle. This task should be run before ane database changes are made. The parameters are reflecting the bundle configuration under bm_backup_manager.

post-release:
    - 'Terminal42\MageTools\Task\Backup\DatabaseBackupTask': { database: 'production', storage: 'local' }

    # Optional parameters:
    # - filename (defaults to: Y-m-d-H:i:s.sql)
    # - compression (defaults to: none)
    # - flags (defaults to: none)

Contao

Terminal42\MageTools\Task\Contao\AutomatorTask

Runs the Contao automator task. You must provide the task name. Execute the Run "vendor/bin/contao-console contao:automator" command to see available tasks.

post-release:
    - 'Terminal42\MageTools\Task\Contao\AutomatorTask': { task: 'purgeSearchCache', env: 'prod' }

Doctrine

Terminal42\MageTools\Task\Doctrine\CacheClearTask

Clear the Doctrine metadata, query and result cache.

post-release:
    - 'Terminal42\MageTools\Task\Doctrine\CacheClearTask': { env: 'prod' }
Terminal42\MageTools\Task\Doctrine\MigrateTask

Run the Doctrine migrations.

post-release:
    - 'Terminal42\MageTools\Task\Doctrine\MigrateTask': { env: 'prod' }

Integrity check

Terminal42\MageTools\Task\IntegrityCheck\ContaoTask

Checks Contao by executing contao:version command in Symfony's console.

pre-deploy:
    - 'Terminal42\MageTools\Task\IntegrityCheck\ContaoTask'

Maintenance

Terminal42\MageTools\Task\Maintenance\LockTask

Enable the maintenance mode.

on-deploy:
    - 'Terminal42\MageTools\Task\Maintenance\LockTask': { env: 'prod' }
Terminal42\MageTools\Task\Maintenance\UnlockTask

Disable the maintenance mode.

post-release:
    - 'Terminal42\MageTools\Task\Maintenance\UnlockTask': { env: 'prod' }

Custom commands

Deploy all

Deploys system to all configured environments.

vendor/bin/mage-terminal42 deploy-all

Connect via SSH

Allows to open the SSH connection based on configured environments.

Basic usage (will take the first host defined for the environment):

vendor/bin/mage-terminal42 ssh production

For multiple hosts given you have config:

hosts:
    - webserver1
    - webserver2
    - webserver3

You can connect to them using:

vendor/bin/mage-terminal42 ssh --host=webserver3 production
vendor/bin/mage-terminal42 ssh --host=2 production

统计信息

  • 总下载量: 22.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固