Download the PHP package setono/deployer-dotenv without Composer
On this page you can find all versions of the php package setono/deployer-dotenv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download setono/deployer-dotenv
More information about setono/deployer-dotenv
Files in setono/deployer-dotenv
Package deployer-dotenv
Short Description Easily update your .env files when deploying
License MIT
Informations about the package deployer-dotenv
DotEnv handling with Deployer
If you use Deployer as your deployment tool
and .env
files to handle environment variables (i.e. Symfony) this library is for you.
Are you still accessing your server to update environment variables manually after a deployment? We also did that and that's the main reason why we built this library.
Now we have a very specific, but simple, strategy for updating the .env
files during deployment:
-
We do not share the
.env.local.php
,.env.local
files as is the default by Deployer. Instead, we have a.env.[stage].local
and.env.local.php
in each release folder. -
When deploying we copy the
.env.[stage].local
file from the previous release (if there was a previous release, else we create it). -
If you are deploying interactively (i.e. manually) you are presented with a dialog asking if you want to update any environment variables.
- Finally, we run
composer symfony:dump-env [stage]
to generate the.env.local.php
file for the current release.
Installation
Usage
In your deploy.php
file require the recipe:
This will automatically hook into the default flow of Deployer.
Testing
-
Set correct permissions on the SSH keys:
-
Build the Docker image:
-
Run the Docker container:
- Run the tests:
All versions of deployer-dotenv with dependencies
deployer/deployer Version ^7.4
symfony/console Version ^6.4 || ^7.0
symfony/dotenv Version ^6.4 || ^7.0
webmozart/assert Version ^1.11