Automated deployment template for Laravel Envoy based on Capistrano.
exolnet/laravel-envoy is a Laravel package for automated deployment template for laravel envoy based on capistrano..
It currently has 23 GitHub stars and 17.257 downloads on Packagist (latest version v1.21.1).
Install it with composer require exolnet/laravel-envoy.
Discover more Laravel packages by exolnet
or browse all Laravel packages to compare alternatives.
Last updated
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 at config/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' => '[email protected]: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 commit abcdef to the remote hostvendor/bin/envoy run deploy:publish --current: Run the deploy: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 to 123456 if specified on the remote hostvendor/bin/envoy run backups: List existing backups on the remote hostYou can also use the native Envoy command too:
vendor/bin/envoy tasks: List available tasks and macrosvendor/bin/envoy ssh: Connect to the remote hostNote 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 [email protected] instead of using the issue tracker.
Copyright © eXolnet. All rights reserved.
This code is licensed under the MIT license. Please see the license file for more information.