Skip to content

Very simple parser to inject environment variables into any file.

Notifications You must be signed in to change notification settings

campanda/parse-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-env

Build Status

Very simple parser to inject environment variables into any file. Useful to achieve environment-agnostic configuration on files that normally don't allow access to env variables natively. (ie. Varnish and Nginx)

Usage

Given the following file, my_config.vcl:

backend default {
    .host = "{{ some_host }}";
    .port = "{{ some_port }}";
}

# ... rest of the file ...

Running this script against the file:

$ ./parse-env my_config.vcl
$ cat my_config.vcl
backend default {
    .host = "foobar.com";
    .port = "8888";
}

Develompent

$ cd test
$ ./run.sh

TODOs

  • right now, the sed command only works on linux, need to adapt it to work on BSD/macOS as well.

About

Very simple parser to inject environment variables into any file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages