Skip to content

Instantly share code, notes, and snippets.

@jeffersonmartin
Created September 29, 2016 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffersonmartin/5bd477efbd2ae759e6eb041757f43f8c to your computer and use it in GitHub Desktop.
Save jeffersonmartin/5bd477efbd2ae759e6eb041757f43f8c to your computer and use it in GitHub Desktop.

Initial Setup of Envoy (for Dev Machine)

When using Envoy for the first time to deploy to production servers, there are quite a few steps to get it running correctly. These are the cliff notes that I use for getting Envoy running.

Create envoy.blade.php in base Laravel project directory

This file includes the descriptive tasks for deployment. Copy this file from an existing repository and make appropriate tweaks.

Include envoy using composer

cd ~/Sites/account-name/repository-name/
composer global require "laravel/envoy=~1.0"

Update machine SSH config for accessing web server

nano ~/.ssh/config

Host 10.100.180.21
  User envoy
  IdentityFile ~/.ssh/envoy

Create SSH key file

nano ~/.ssh/envoy

-----BEGIN RSA PRIVATE KEY-----
{REDACTED}
-----END RSA PRIVATE KEY-----

chmod 600 ~/.ssh/envoy

Add Composer Vendor Bin to System Path

export PATH=$PATH:~/.composer/vendor/bin

Alternatively,
nano ~/.bash_profile

export PATH=~/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:~/.composer/vendor/bin:$PATH

Restart bash profile

source ~/.bash_profile

Ensure correct permissions on web server (verify if this works)

ssh root@10.100.180.21
cd /srv/www
chown -R envoy:www-data

Run commands to test

cd ~/Sites/account-name/repository-name/
envoy run admin-prod-deploy
envoy run admin-prod-rollback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment