DEPRECATED This functionality has been merged into https://github.com/weavejester/environ
Compatibility layer with the 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 boot-runit in your deployment strategy.
(set-env! :dependencies ‘[[danielsz/boot-environ "0.0.5"]])
(comp
...
(environ :env {:http-port 3000} :verbose true)
...
)
As with any boot task, the environment map can be specified in a build pipeline or at the command line. Please refer to system or holygrail for usage examples.