lddsb / replace-env

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

replace-env

It works great when there has different .env(.env.json) file for different environment.

How it works

You need set your different environment variables for different environment in your operate system.For example:

...
export DEV_HTTPS=false
export PROD_HTTPS=true
...

and your .env should like:

...
HTTPS=
...

Usage

replace-env source-file output-file

.env

replace-env e .env.example .env

.env.json

replace j .env.json.example .env.json

custom branch environment variables(default: CI_COMMIT_BRANCH)

Drone CI
replace e --branch-env DRONE_BRANCH .env.example .env

GitLab CI

replace e --branch-env CI_COMMIT_BRANCH .env.example .env

About

License:MIT License


Languages

Language:Go 100.0%