2017 © Pedro Peláez
 

library deeployer

A Laravel 4.1+ automatic application deployment package via git webhooks

image

pragmarx/deeployer

A Laravel 4.1+ automatic application deployment package via git webhooks

  • Wednesday, February 18, 2015
  • by AntonioCarlosRibeiro
  • Repository
  • 12 Watchers
  • 151 Stars
  • 663 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 3 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Deeployer

Latest Stable Version, (*1)

Automatically deploy Laravel applications every time it's pushed to the remote repository

Deployment via git webhooks is a common functionallity of most PaaS these days. This package is intended to be used for those that are hosting their websites in VPS, dedicated server or any other hosting provider that doesn't support web hooks., (*2)

Since this package uses Laravel remote (SSH-2) functionality to remote or locally deploy applications, your deployment app can be in one server and deploy applications to others, as many as you need., (*3)

Compatibility

This package currently works with, (*4)

  • Github
  • Bitbucket

Using it with Laravel Envoy

Define an url for your deployer to be used, in Github you can find this at Settings > Service Hooks > WebHook URLs > URL, example:, (*5)

http://deployer.yoursite.io/deploy

Create a route in your application for the deployer url:, (*6)

Route::post('deploy', function() 
{
    return Deeployer::run();
});

If you are using Laravel Envoy, install it and create tasks using your project url and the branch as the task name:, (*7)

@task('https://github.com/you/repo-name:master', ['on' => ['localhost']])
    touch /tmp/envoy-passthrough.txt
@endtask

And that's it, you're good to go! Configure your webook, push something and wait for it., (*8)

Normal Usage

If you prefer to use Deeployer own deployment system, edit the file app/config/packages/pragmarx/deeployer/config.php and create your projects. In my opinion, is better to not use the master branch while automatically deploying apps:, (*9)

'projects' => array(
                        array(
                                'ssh_connection' => 'yoursite-staging',

                                'git_repository' => 'https://github.com/yourname/yoursite.io',

                                'git_remote' => 'origin',

                                'git_branch' => 'staging',

                                'remote_directory' => '/var/www/vhosts/yoursite.io/staging/',

                                'composer_update' => true,

                                'composer_optimize_autoload' => true,

                                'composer_extra_options' => '',

                                'composer_timeout' => 60 * 5, // 5 minutes

                                'artisan_migrate' => false,

                                'post_deploy_commands' => array(
                                                                    'zsh send-deployment-emails.sh',
                                                                ),
                            ),
                    ),

Create the remote connection by editing app/config/remote.php:, (*10)

    'connections' => array(

        'yoursite-staging' => array(
            'host'     => 'yoursite.com:22', <-- you can set a different SSH port if you need 
            'username' => 'root',            <-- the user you use to deploy applications on your server
            'password' => 'Bassw0rt',
            'key'      => '',                <-- key files are safer than passwords
            'root'     => '/var/www',        <-- you can ignore this, deployment path will be changed by Deeployer
        ),

    ),

Go to your server and tail the log file:, (*11)

php artisan tail

Add that url to Github or Bitbucket., (*12)

Push something to your branch to automatically deploy your application:, (*13)

git pull origin master:testing
git pull origin master:staging
git pull origin master:production

If you are just testing, in Github you can press 'Test Hook' button, after saving your URL., (*14)

Installation

Requirements

  • Laravel 4.1+
  • Composer >= 2014-01-07 - This is a PSR-4 package
  • SSH-2 Server

Installing

First, you need to be sure you have a Composer that supports PSR-4, so execute, (*15)

composer self-update

or, (*16)

sudo composer self-update

Require the Deeployer package:, (*17)

composer require pragmarx/deeployer dev-master

Once this operation completes, add the service provider to your app/config/app.php:, (*18)

'PragmaRX\Deeployer\Vendor\Laravel\ServiceProvider',

Publish and edit the configuration file:, (*19)

artisan config:publish pragmarx/deeployer

TODO

  • Create a deployment artisan command, to manually deploy something troubled.
  • Tests, tests, tests., (*20)

  • Bitbucket is not done yet. (DONE!), (*21)

Author

Antonio Carlos Ribeiro - acr@antoniocarlosribeiro.com - http://twitter.com/iantonioribeiro, (*22)

License

Deeployer is licensed under the MIT License - see the LICENSE file for details, (*23)

Contributing

Pull requests and issues are more than welcome., (*24)

The Versions

18/02 2015

dev-master

9999999-dev

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel deployment deploy envoy

18/02 2015

v0.8.4

0.8.4.0

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel deployment deploy envoy

22/10 2014

v0.8.3

0.8.3.0

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel deployment deploy envoy

21/10 2014

v0.8.2

0.8.2.0

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel deployment deploy envoy

13/02 2014

v0.8.1

0.8.1.0

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel deployment deploy envoy

13/02 2014

dev-develop

dev-develop

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel deployment deploy

12/01 2014

dev-unstable

dev-unstable

A Laravel 4.1+ automatic application deployment package via git webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

by eRobin

laravel deployment deploy

10/01 2014

v0.8.0

0.8.0.0

  Sources   Download

The Requires

 

The Development Requires

by eRobin