PHPackages                             pragmarx/deeployer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. pragmarx/deeployer

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

pragmarx/deeployer
==================

A Laravel 4.1+ automatic application deployment package via git webhooks

v0.8.4(11y ago)14766811[4 issues](https://github.com/antonioribeiro/deeployer/issues)MITPHPPHP &gt;=5.3.7

Since Jan 10Pushed 11y ago12 watchersCompare

[ Source](https://github.com/antonioribeiro/deeployer)[ Packagist](https://packagist.org/packages/pragmarx/deeployer)[ RSS](/packages/pragmarx-deeployer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (8)Used By (0)

Deeployer
=========

[](#deeployer)

[![Latest Stable Version](https://camo.githubusercontent.com/2c46a4783221a98af4c5684fef6283db05e4b27b1e4f8a9af501beed3a67f961/68747470733a2f2f706f7365722e707567782e6f72672f707261676d6172782f646565706c6f7965722f762f737461626c652e706e67)](https://packagist.org/packages/pragmarx/deeployer)

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

[](#automatically-deploy-laravel-applications-every-time-its-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.

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.

#### Compatibility

[](#compatibility)

This package currently works with

- Github
- Bitbucket

### Using it with Laravel Envoy

[](#using-it-with-laravel-envoy)

Define an url for your deployer to be used, in Github you can find this at Settings &gt; Service Hooks &gt; WebHook URLs &gt; URL, example:

```
http://deployer.yoursite.io/deploy

```

Create a route in your application for the deployer url:

```
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:

```
@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.

### Normal Usage

[](#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:

```
'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`:

```
	'connections' => array(

		'yoursite-staging' => array(
			'host'     => 'yoursite.com:22',  'root',             'Bassw0rt',
			'key'      => '',                 '/var/www',
