Working with your .env file
The workflow around this can be tricky. Going from Local, to Travis CI, to CodeDeploy
, and then to AWS without storing your information in .env
on GitHub can be a challenge. What I will show here are some tools and techniques to do this well.
Getting ready
A base installation is fine; I will use the existing installation to show some tricks around this.
How to do it…
Minimize the
.env
variable using Conventions as much as possible:config/queue.php
I can do this to have one or more Queues:config/filesystems.php
:
Use the
Config
file as much as possible. For example, this is in my.env
:But I can also add
config/marvel.php
, and then make it look like this:My
.env
file can be trimmed down byKEY=VALUES
later on I can call to those:Config::get('marvel.MARVEL_API_VERSION)
Config::get('marvel.MARVEL_API_BASE_URL')
Now, to easily send to Staging or Production using the
EnvDeployer
library, run the following:>composer require alfred-nutile-inc/env-deployer:dev-master...