2017 © Pedro Peláez
 

library minion

Framework and language agnostic remote deployment automation tool

image

nimbly/minion

Framework and language agnostic remote deployment automation tool

  • Monday, June 19, 2017
  • by brentscheffler
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4,211 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 9 % Grown

The README.md

How it works

minion creates a new checkout/clone of your repo for each deployment. This allows clean installs and easy rollbacks to previous releases. The general idea is a single directory holds the releases and a symlink points to the current release., (*1)

NOTE: In order for this to work with your webserver (Apache, Nginx, etc), you will need to update its configuration to point to the symlink as its webroot., (*2)

During deployment, minion will apply your deployment strategy on each defined server. A deployment strategy is simply a list of tasks you would like minion to run., (*3)

minion has several built-in tasks - however, you will need to create and implement your own tasks to take full advantage. Some examples: install composer, run migrations, flush caches, restart web service, restart web application, etc., (*4)

Install

composer require nimbly/minion, (*5)

Initialize

minion make:init, (*6)

Configure

If you run the make:init command, minion will create a couple directories (Tasks and Commands) as well as generate a default configuration file (minion.yml)., (*7)

The first several sections of the config file define global config options. Each environment defined may optionally override these global options., (*8)

The global sections are:, (*9)

  • remote
  • authentication
  • code

remote

The remote section defines options on the remote server environment including where to deploy code., (*10)

The options for the remote sections are as follows:, (*11)

  • path [string] The absolute path to the code on the server. I.e. the path to deploy code to., (*12)

  • releaseDir [string] The path to keep the releases (relative to path)., (*13)

  • symlink [string] Name of the symlink to create to point to current release., (*14)

  • keepReleases [integer] The number of releases to keep before pruning old releases., (*15)

authentication

The authentication section defines how SSH can authenticate with your servers. You can either authenticate with a username and password or using a username, key and (optionally) a key pass phrase., (*16)

NOTE: because minion uses PHPSECLIB as its core SSH library, you can only use RSA keys - DSA keys are not supported at this time., (*17)

The options for the authentication sections are as follows:, (*18)

  • username [string] The SSH username to connect with., (*19)

  • password [string] optional The SSH password to use (if not using key based authentication)., (*20)

  • key [string] optional Path and file name of RSA key file., (*21)

  • passphrase [string] optional Pass phrase for key (if using key based authentication)., (*22)

code

The code section defines how and where your code is stored., (*23)

  • scm [git, svn] What source code management tool you use., (*24)

  • repo [string] Repository URL/location, (*25)

  • branch [string] optional Repository branch (if any), (*26)

  • username [string] optional Repository username, (*27)

  • password [string] optional Repository password, (*28)

environments

This section is where you define your server groups or environments. Each environment has a unique name and a list of servers. You must define a deployment strategy and provide an array of servers. A server must have a host property., (*29)

  • strategy [string] Comma separated list of tasks to run, in the order specified.
  • servers [array] Array of servers to deploy to
  • preDeploy [string] Comma separated list of tasks to run before the deploy happens. These tasks will be run on the local machine (i.e. not remotely).
  • postDeploy [string] Comma separate list of tasks to run after the deploy happens. These tasks will be run on the local machine (i.e. not remotely).

For example:, (*30)

environments:
    production:
        strategy: release, link, prune
        servers:
            - host: web-001.example.com
            - host: web-002.example.com
            - host: web-003.example.com

Within each environment, you may override some or all global options. For example, if your staging environment has a different set of SSH keys used to authenticate and uses the staging branch of your repo, you can define those changes within the staging environment., (*31)

For example:, (*32)

environments:
    staging:
        strategy: release, link, prune
        code:
            branch: staging
        authentication:
            username: deploy
            key: staging_id_rsa.pub
        servers:
            - host: staging-001.example.com
            - host: staging-002.example.com

A server may also override the environment strategy. This is useful if you have several servers and need to run a migration as it only needs to be run once., (*33)

For example:, (*34)

environments:
    staging:

        code:
            branch: staging

        authentication:
            username: deploy
            key: staging_id_rsa.pub

        strategy: release, link, prune

        servers:
            - host: staging-001.example.com
              strategy: release, link, migrate, prune
            - host: staging-002.example.com

Tasks

A task is one or more shell commands that are issued on the remote server. minion is pre-configured with four tasks., (*35)

  • release Creates a new release on the server.
  • link Symlinks the newly created release to the current release directory (current by default).
  • prune Prunes (deletes) old release directories.
  • update Does a code update on the current release (git pull or svn up)

Extending

minion can be extended by creating new custom commands as well as custom tasks., (*36)

Commands

To create a new command:, (*37)

minion make:command <name>, (*38)

For example:, (*39)

minion make:command CacheFlushCommand, (*40)

Custom commands can be found in the Commands directory where you run minion from., (*41)

minion commands are powered by Symfony Console. Please refer to [http://symfony.com/doc/current/components/console.html] for documentation., (*42)

Tasks

To create a new task:, (*43)

minion make:task <name>, (*44)

For example:, (*45)

minion make:task Migrate, (*46)

Custom tasks can be found in the Tasks directory where you run minion from., (*47)

The Versions

19/06 2017

dev-master

9999999-dev

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

20/04 2017

2.1.2

2.1.2.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

18/04 2017

2.1.1

2.1.1.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/02 2017

2.1

2.1.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/02 2017

2.0.6

2.0.6.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/02 2017

2.0.5

2.0.5.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

19/02 2017

2.0.4

2.0.4.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

19/02 2017

2.0.3

2.0.3.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

19/02 2017

2.0.2

2.0.2.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

19/02 2017

2.0.1

2.0.1.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

19/02 2017

2.0

2.0.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

13/02 2017

1.5

1.5.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

21/11 2016

1.4

1.4.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

18/11 2016

1.3.1

1.3.1.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/10 2015

1.2.2

1.2.2.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/10 2015

1.2

1.2.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/10 2015

1.1

1.1.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/10 2015

dev-tags/1.0

dev-tags/1.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation

22/10 2015

1

1.0.0.0

Framework and language agnostic remote deployment automation tool

  Sources   Download

MIT

The Requires

 

by Brent Scheffler

php remote deployment automation