• Stars
    star
    146
  • Rank 245,033 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deploy your Laravel applications via Github or Bitbucket Hooks

Deeployer

Latest Stable Version

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.

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

This package currently works with

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

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

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

php artisan tail

Add that url to Github or Bitbucket.

Push something to your branch to automatically deploy your application:

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.

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

composer self-update

or

sudo composer self-update

Require the Deeployer package:

composer require pragmarx/deeployer dev-master

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

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

Publish and edit the configuration file:

artisan config:publish pragmarx/deeployer

TODO

  • Create a deployment artisan command, to manually deploy something troubled.

  • Tests, tests, tests.

  • Bitbucket is not done yet. (DONE!)

Author

Antonio Carlos Ribeiro - [email protected] - http://twitter.com/iantonioribeiro

License

Deeployer is licensed under the MIT License - see the LICENSE file for details

Contributing

Pull requests and issues are more than welcome.

More Repositories

1

tracker

Laravel Stats Tracker
PHP
2,824
star
2

health

Laravel Health Panel
PHP
1,879
star
3

countries

Laravel countries and currencies
PHP
1,741
star
4

google2fa

A One Time Password Authentication package, compatible with Google Authenticator.
PHP
1,684
star
5

firewall

Firewall package for Laravel applications
PHP
1,362
star
6

google2fa-laravel

A One Time Password Authentication package, compatible with Google Authenticator for Laravel
PHP
825
star
7

tddd

A Laravel Continuous Integration Package
Vue
727
star
8

version

Laravel App versioning
PHP
565
star
9

laravelcs

Laravel PHP_CodeSniffer
PHP
236
star
10

countries-laravel

Countries for Laravel
PHP
141
star
11

yaml

A Laravel YAML parser and config loader
PHP
110
star
12

zipcode

Zip code searcher
PHP
97
star
13

steroids

Laravel 4 Blade on Steroids
PHP
95
star
14

coollection

Laravel Collection Objectified
PHP
87
star
15

google2fa-qrcode

QRCode for Google2FA
PHP
84
star
16

recovery

Create recovery/backup codes for 2FA
PHP
72
star
17

random

Generate random strings or numeric values
PHP
70
star
18

glottos

A PHP 5.3+ Translation/Localization System
PHP
69
star
19

sqli

A Laravel Artisan SQL Interactive Interface
PHP
60
star
20

support

Support Classes
PHP
58
star
21

ia-arr

Laravel Illuminate Agnostic Arr
PHP
49
star
22

ia-str

Laravel Illuminate Agnostic Str
PHP
46
star
23

ia-collection

Laravel Illuminate Agnostic Collection
PHP
43
star
24

artisan-anywhere

Execute Artisan from anywhere in your Laravel project tree
43
star
25

dev-box

Development Box Provisioning in Ansible
Shell
41
star
26

artisan-tool

Nova Artisan Tool
PHP
35
star
27

glottosAdmin

Glottos Admin Panel and Starter
JavaScript
27
star
28

laravel-installer

Laravel Framework Installer Script for Unlix-Like Systems
Shell
26
star
29

google2fa-starter

Google2FA Starter App
PHP
26
star
30

tddd-starter

Laravel TDDD Starter App
PHP
23
star
31

nova-boolean-datetime-field

A Laravel Nova Boolean DateTime field
PHP
20
star
32

skel

A PHP Package Creator & Skeleton
Shell
12
star
33

health-docker

App Health Panel for Docker Environments
PHP
8
star
34

google2fa-php

A One Time Password Authentication PHP class, compatible with Google Authenticator
PHP
6
star
35

lumen-image-processor

Lumen Image Processor
PHP
5
star
36

http-basic-auth

HTTP Basic Auth middleware for Laravel
Shell
3
star
37

trivia

Trivia database
PHP
3
star
38

vanhack-agentbot

Vanhack Agent Bot
PHP
3
star
39

pragmarx.com

Source of pragmarx.com
PHP
3
star
40

zsh

zsh
Shell
3
star
41

backup-server

backup-server
PHP
3
star
42

googleforms

Post to Google Form Spreadsheets
PHP
2
star
43

sdk

sdk
PHP
1
star
44

fluxbb-style

The FluxBB style for the Laravel forums.
1
star
45

core-libraries

core libraries
PHP
1
star
46

veveystore

Vevey Store
HTML
1
star
47

a17ex

Area 17 Exercice
PHP
1
star
48

church.api

Church API
PHP
1
star