2017 © Pedro Peláez
 

library dployer

A simple script to deploy PHP applications to AWS ElasticBeanstalk

image

leroy-merlin-br/dployer

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  • Friday, January 19, 2018
  • by gmsantos
  • Repository
  • 17 Watchers
  • 12 Stars
  • 916 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 13 Versions
  • 4 % Grown

The README.md

dployer

A simple script to deploy PHP applications in a few minutes to ElasticBeanstalk., (*1)



Installation

Composer

composer global require "leroy-merlin-br/dployer=*@dev"

Global config for dployer

AWS config

You have 2 options to configure AWS:, (*2)

  • Environment Variables
  • JSON configuration file

Environment Variables

You must fill the following environment variables., (*3)

  • DPLOYER_PROFILE : Your profile's name in AWS.
  • DPLOYER_REGION : Your region you want to deploy something.
  • DPLOYER_AWS_KEY : Your secret AWS key.
  • DPLOYER_AWS_SECRET : Your secret AWS SECRET.

JSON Configuration File

  • Create the following configuration file: ~/.aws/config.json
{
    "includes": ["_aws"],
    "services": {
        "default_settings": {
            "params": {
                "profile": "my_profile",
                "region": "sa-east-1",
                "key": "YOURSUPERKEY",
                "secret": "YoUrSuPeRsEcReT"
            }
        }
    }
}

AWS Bucket

Add the following line in the end of the ~/.bashrc file:, (*4)

export DPLOYER_BUCKET=your-bucket-identifier-0-12345678

Usage

Inside the folder that you want to deploy, just run:, (*5)

dployer deploy ApplicationName elasticbeanstalked-environment

Options

You can use the following options:, (*6)

  • -c (--config): Use a custom configuration file different from .dployer
  • -i (--interactive): Asks before run each command in configuration file
  • -v (--verbose): Display command outputs
  • -f (--force): Continue with deploy process even if a script exits with error

Project configuration

In order to optimize the deploy of your project, you can create a configuration file to keep application and environment variables. In addition, you gain some extra features, like: events to run the scripts that you want and options to copy extra files and delete some files before zip them., (*7)

Just create a .dployer file in project root dir., (*8)

Note: Once you have .dployer file with application and environment variables defined, you can just run the command as following:, (*9)

dployer deploy

Sample .dployer

{
    "application": "ApplicationName",
    "environment": "my-environment",
    "scripts": {
        "init": "composer dumpautoload",
        "before-pack": [
            "gulp build --production"
        ],
        "before-deploy": [
            "echo 'Deploying new version'",
            "echo 'Another important command to run before deploy'"
        ],
        "finish": [
            "gulp clean",
            "echo 'Nicely done'"
        ]
    },
    "copy-paths": [
        "vendor",
        "public/assets"
    ],
    "exclude-paths": [
        ".git",
        "vendor/**/*.git"
    ]
}

Events

Dployer triggers 4 events in deploy flow:, (*10)

  • init: Runs after initial validations and before any command of deploy
  • before-pack: Runs before create the zip file
  • before-deploy: Runs before create ElasticBeanstalk version and upload zip
  • finish: Runs after upload new version

copy-paths

The dployer just clone your current git branch inside a temp folder, then it creates a zip file. But sometimes, you want to deploy some files which are ignored by git (inside .gitignore file)., (*11)

In this case, you can put these files/folders in copy-paths key in configuration file as demonstrated in sample section., (*12)

.dployer, (*13)

(...)
"copy-paths": [
    "vendor",
    "public/assets/"
]
(...)

exclude-paths

In another case, sometimes you want to exclude some files/folders too., (*14)

.dployer, (*15)

(...)
"exclude-paths": [
    ".git",
    "vendor/**/*.git"
]
(...)

The Versions

19/01 2018

dev-master

9999999-dev

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

19/01 2018

v1.4.1

1.4.1.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

19/01 2018

dev-bump-bin

dev-bump-bin

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

18/01 2018

v1.4

1.4.0.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

03/10 2017

dev-export-config-to-env

dev-export-config-to-env

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

28/12 2016

v1.3

1.3.0.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

The Development Requires

aws deploy elasticbeanstalk ebs

15/12 2015

v1.2.3

1.2.3.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

19/10 2015

v1.2.2

1.2.2.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

07/10 2015

v1.2.1

1.2.1.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

30/09 2015

v1.2

1.2.0.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

30/09 2015

v1.1

1.1.0.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

30/01 2015

v1.0.1

1.0.1.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs

16/01 2015

v1.0.0

1.0.0.0

A simple script to deploy PHP applications to AWS ElasticBeanstalk

  Sources   Download

MIT

The Requires

 

aws deploy elasticbeanstalk ebs