README.org
February 14, 2016 · View on GitHub
- Boot environ
DEPRECATED This functionality has been merged into https://github.com/weavejester/environ
** What is it?
Compatibility layer with the [[https://github.com/weavejester/environ][environ]] library by James Reeves.
The environ library ships with a Leiningen plugin that will write an environment map specified in project.clj to disk. Typically, this file is git ignored so that your passwords stay safe. In Boot, the round-trip via the filesystem is not necessary. Since there is only one single JVM instance, we can update the map directly in the #’environ.core namespace. With the net result of being able to leverage environ in the same way as with Leiningen.
In production, you’ll likely use environment variables, set in the shell or defined as java properties. Those are also supported by the environ library. Another option is to use [[https://github.com/danielsz/boot-runit][boot-runit]] in your deployment strategy.
** Installation
#+BEGIN_SRC clojure (set-env! :dependencies ‘[[danielsz/boot-environ "0.0.5"]]) #+END_SRC ** Usage
#+BEGIN_SRC clojure (comp ... (environ :env {:http-port 3000} :verbose true) ... ) #+END_SRC As with any boot task, the environment map can be specified in a build pipeline or at the command line. Please refer to [[https://github.com/danielsz/system/tree/master/examples/boot][system]] or [[https://github.com/danielsz/holygrail][holygrail]] for usage examples.