exolnet / laravel-envoy
Automated deployment template for Laravel Envoy based on Capistrano.
Installs: 10 633
Dependents: 0
Suggesters: 0
Security: 0
Stars: 22
Watchers: 10
Forks: 7
Open Issues: 3
Requires
- php: ^8.0
- exolnet/envoy: ^1.110.0
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.3.3
- squizlabs/php_codesniffer: ^3.6
- dev-master
- v1.18.1
- v1.18.0
- v1.18.0-RC3
- v1.18.0-RC2
- v1.18.0-RC1
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.1
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.1
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- v1.0.0-rc.4
- v1.0.0-rc.3
- v1.0.0-rc.2
- v1.0.0-rc.1
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.1
- v0.2.0
- v0.1.1
- v0.1.0
- dev-feature/php83-support
- dev-feature/laravel-10-support
- dev-feature/laravel-pint
This package is auto-updated.
Last update: 2024-11-17 16:44:17 UTC
README
This repository contains automated deployment template for Laravel Envoy. The deployment flow is based on Capistrano.
Installation
-
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!
Upgrade
Please read UPGRADE-1.x for the procedure to upgrade to version 1.x.
Usage
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.
Contributing
Please see CONTRIBUTING and CODE OF CONDUCT for details.
Security
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.
Credits
- Alexandre D'Eschambeault
- Tom Rochette
- Patricia Gagnon-Renaud
- Simon Gaudreau
- Martin Blanchette
- All Contributors
License
This code is licensed under the MIT license. Please see the license file for more information.