Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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