Setup Envoy Laravel Linux

Setup Envoy Laravel Linux is easy and gives many advantages.Laravel is very popular today,Laravel Envoy provides a clean, minimal syntax for running tasks on remote servers without effort. Using a Blade style syntax (Laravel uses), you can easily setup tasks for deployment, Artisan commands, or scripts.

This tutorial will help you to do the Basic Steps in set upping the Envoy.Here, I am explaining this with the Laravel Envoy.I hope you are familiarized with the Blade syntax, Artisan Commands etc.

Envoy Installation

Add the following ine to your composer.json file :

 composer global require "laravel/envoy=~1.0"

Initial Setup

Create an Envoy.blade.php file, in the root directory

@servers(['web' => 'Ipaddress'])

@task('foo', ['on' => 'web'])
    ls -la
@endtask

Also, you can create the Envoy file using the command :

 envoy init user@Ipaddress

Running Tasks in Envoy

To run a task in Envoy :

 $envoy run command1

If you want to pass variable through command line use :

 envoy run deploy --branch=master

Update Envoy

 composer global update

I am using Envoy to execute the git commands on server from my local system. So, that it will automatically do the rest of the job in the server.In order to work this you have to first establish a SSH Connection between the repository and the server.

Example

@servers(['live' => 'user@IPaddress'])

@task('update', ['on' => 'livewebsite'])

@if($website == 'livewebsite')
cd /home/Project/Live
@else
cd /home/Project/Testing
@endif
git pull --rebase
/usr/local/bin/composer dumpautoload -o

@endtask

Envoy uses the Blade Templating to format the Envoy Commands.
Zero Downtime is the great advantage of using Envoyer.
I am using Laravel Envoy for project deployment.And i have to say this is amazing to deploy,update and for more.

Note: More detailed explanation is available on Laravel Envoy.