Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinOrlowski committed Apr 14, 2016
1 parent 280a76d commit 52d582d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# DotEnv building Helper #
# Process DotEnv - .env building helper tool #

DotEnv file (`.env`) are often used as runtime configuration files (i.e. Laravel based PHP projects)
and are not stored in your repository, so if you use Continuous Integration (CI) tools like Team City,
you need to create that `.env` file before tests can be started. DotEnv Helper is created to help
you with step.
you need to create that `.env` file before tests can be started. Process DotEnv tool wass created to
help you with step.

The main assumption is that you usually have file like `.env.dist` in your repository (so people
know how to create production `.env`). DotEnv helper reads that file and tries to get values
know how to create production `.env`). This tool reads that file and tries to get values
for keys present in the file by looking into environmental variables or command line arguments
to produce populated, ready to use DotEnv file. Having `.env` created that way lets you keep all
needed runtime configuration (i.e. API keys etc) directly in CI configuration, in run step in Team City.
Expand All @@ -26,7 +26,7 @@ then knowing you want to have own value set for `KEY` you set your build
step in CI as shell script:

export KEY=bar
vendor/bin/process-env .env.dist > .env
vendor/bin/process-dotenv .env.dist > .env

which shall produce `.env` file with content as follow:

Expand All @@ -40,10 +40,10 @@ and `FOO`, for which we did not provide replacements, were copied unaltered.

## Argument subsitution ##

Aside of env variables you can also pass `key=val` arguments to `process-env` achieve the same
Aside of env variables you can also pass `key=val` arguments to `process-dotenv` achieve the same
goal:

vendor/bin/process-env .env.dist KEY=bar > .env
vendor/bin/process-dotenv .env.dist KEY=bar > .env

**IMPORTANT:** first argument always refers to source env file.

Expand All @@ -54,7 +54,7 @@ Both substitution methods can be used together. When key is provided as argument
also exists as Env variable, then command line provided value will be used:

export KEY=bar
vendor/bin/process-env .env.dist KEY=foo > .env
vendor/bin/process-dotenv .env.dist KEY=foo > .env

will produce:

Expand All @@ -67,10 +67,10 @@ will produce:

Use composer to install this package as your development dependency:

composer require --dev marcin-orlowski/dotenv-helper
composer require --dev marcin-orlowski/process-dotenv


It will install `process-env` script in usual `vendor/bin` folder.
It will install `process-dotenv` script in usual `vendor/bin` folder.


## License ##
Expand Down

0 comments on commit 52d582d

Please sign in to comment.