2017 © Pedro Peláez
 

library mage-tools

Magephp tools for easier deployment of Contao and Symfony systems.

image

terminal42/mage-tools

Magephp tools for easier deployment of Contao and Symfony systems.

  • Friday, May 25, 2018
  • by aschempp
  • Repository
  • 3 Watchers
  • 3 Stars
  • 3,430 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 27 % Grown

The README.md

Mage Tools for deployment

A set of predefined tasks and helpful libraries for the Magallanes PHP Deployment Tool., (*1)

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., (*2)

Usage

To use the tasks simply added them to your .mage.yml file. The recommended setup is:, (*3)

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., (*4)

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., (*5)

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., (*6)

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., (*7)

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., (*8)

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

Run the Doctrine migrations., (*9)

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., (*10)

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

Maintenance

Terminal42\MageTools\Task\Maintenance\LockTask

Enable the maintenance mode., (*11)

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

Disable the maintenance mode., (*12)

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

Custom commands

Deploy all

Deploys system to all configured environments., (*13)

vendor/bin/mage-terminal42 deploy-all

Connect via SSH

Allows to open the SSH connection based on configured environments., (*14)

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

vendor/bin/mage-terminal42 ssh production

For multiple hosts given you have config:, (*16)

hosts:
    - webserver1
    - webserver2
    - webserver3

You can connect to them using:, (*17)

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

The Versions

25/05 2018

dev-develop

dev-develop

Magephp tools for easier deployment of Contao and Symfony systems.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony deployment contao mage magephp

27/03 2017

dev-log-rename

dev-log-rename

Magephp tools for easier deployment of Contao and Symfony systems.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony deployment contao mage magephp

04/02 2017

dev-master

9999999-dev

Magephp tools for easier deployment of Contao and Symfony systems.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony deployment contao mage magephp