Leiningen plugin to merge .env into environment variables
A Leiningen plugin to load variables from .env into the environment of your
project, in a manner compatible with Foreman, the Ruby dotenv gem, and
many other tools and libraries. This is a development convenience to enable a
seamless transition to a 12 factor deployment,
which mandates configuration in the environment.
This plugin works by overriding the environment Leiningen spawns your project
with, which provides two key advantages over a plain library approach:
To install at the user level, put [lein-dotenv "RELEASE"] into the
:plugins vector of your :user profile in ~/.lein/profiles.clj.
{:user {:plugins [[lein-dotenv "RELEASE"]]}}
The plugin will also work on a per project level if added to project.clj.
This may be preferable if you want to avoid imposing user profile
requirements on all contributors.
{defproject myproject "0.1.0-SNAPSHOT"
{:profiles {:dev {:plugins [[lein-dotenv "RELEASE"]]}}}}
Create a file named .env at the root of your project and use shell syntax to
declare your variables.
HELLO=Hello
GREETING="$HELLO, world!"
LITERAL='$VARs are not interpolated in single quotes'
The .env file is also used by Foreman and similar tools
Copyright © Tim Pope
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.