Envoy is a simple tool developed by the Laravel team. It is designed to perform task like deploying a website on a remote server, e.g. your VPS.
1 | envoy run deploy |
How does it work?
Take a look at one example of the Envoy.blade.php, which is the task definition file you will need to make it work.
1 2 3 4 5 6 7 | @servers(['web' => 'root@yourdomain.com']) @task('deploy') cd /var/www/website git pull origin master php artisan migrate @endtask |
While you can see there is no magic behind Envoy – it merely SSH login to the remote server and run the commands one by one. It provides a simple and elegant command line interface to use.
Install Envoy (with Composer)
1 | composer global require "laravel/envoy=~1.0" |
Add composer ‘s bin directory to your path
1 2 | echo "PATH=$PATH:~/.composer/bin" >> ~/.bash_profile source ~/.bash_profile |
Create your Envoy task definition file
1 2 | cd /path/to/myproject envoy init root@yourdomain.com |
Edit the generated Envoy.blade.php then you are good to go!