This repository contains automated deployment template for Laravel Envoy. The deployment flow is based on Capistrano.
-
Require this package with composer:
composer require --dev exolnet/laravel-envoy:"^1.9"
-
Create a
Envoy.blade.php
on your project's root with the following content:@import('exolnet/laravel-envoy')
For a typical Laravel project, you should have a file looking like:
@import('exolnet/laravel-envoy') @task('deploy:publish') cd "{{ $releasePath }}" php artisan down php artisan config:cache php artisan event:cache php artisan route:cache php artisan view:cache php artisan storage:link php artisan migrate --force php artisan up @endtask
-
Create your deployment configuration in your Laravel project at
config/deploy.php
. An example config file is provided in this repository atconfig/deploy.php
For a typical Laravel project, you should have a file looking like:
<?php return [ 'name' => 'example', 'default' => 'production', 'environments' => [ 'production' => [ 'ssh_host' => 'example.com', 'ssh_user' => 'example', 'deploy_path' => '/srv/example', 'repository_url' => 'git@github.com:example/example.git', 'linked_files' => ['.env'], 'linked_dirs' => ['storage/app', 'storage/framework', 'storage/logs'], 'copied_dirs' => ['node_modules', 'vendor'], ], ], ];
-
Enjoy!
Please read UPGRADE-1.x for the procedure to upgrade to version 1.x.
The following macro are available:
vendor/bin/envoy run setup
: Setup the directory structure and repository on the remote hostvendor/bin/envoy run deploy --commit=abcdef
: Deploy commitabcdef
to the remote hostvendor/bin/envoy run deploy:publish --current
: Run thedeploy:publish
task for the current release on the remote hostvendor/bin/envoy run releases
: List available releases on the remote hostvendor/bin/envoy run rollback [--release=123456]
: Rollback to previous release or to123456
if specified on the remote hostvendor/bin/envoy run backups
: List existing backups on the remote host
You can also use the native Envoy command too:
vendor/bin/envoy tasks
: List available tasks and macrosvendor/bin/envoy ssh
: Connect to the remote host
Note that you can also use the option --env=foo
with any of the previous command to connect to an other remote
define in the configuration.
Please see CONTRIBUTING and CODE OF CONDUCT for details.
SSH StrictHostKeyChecking
is enforced when using git over ssh. If your remote git repository server does not support SSHFP
/VerifyHostKeyDNS
, you will need to manually create the known_hosts
file on the remote host.
If you discover any security related issues, please email security@exolnet.com instead of using the issue tracker.
- Alexandre D'Eschambeault
- Tom Rochette
- Pat Gagnon-Renaud
- Simon Gaudreau
- Martin Blanchette
- All Contributors
This code is licensed under the MIT license. Please see the license file for more information.