### Define Environment Profiles in profiles.clj Source: https://github.com/weavejester/environ/blob/master/README.md Example of setting `database-url` for development and testing environments within a `profiles.clj` file, which merges with `project.clj` profiles. ```Clojure {:dev {:env {:database-url "jdbc:postgresql://localhost/dev"}} :test {:env {:database-url "jdbc:postgresql://localhost/test"}}} ``` -------------------------------- ### Set Environment Variables via Boot CLI Source: https://github.com/weavejester/environ/blob/master/README.md Example of setting an environment variable directly via the Boot command line using the `environ` task, useful for quick testing or specific runs. ```Bash boot environ -e database-url=jdbc:postgresql://localhost/dev repl ``` -------------------------------- ### Add Environ Dependency to Boot Project Source: https://github.com/weavejester/environ/blob/master/README.md For Boot toolchain users, include the `boot-environ` dependency in your `build.boot` file to read and write settings from build pipelines. ```Clojure :dependencies '[[boot-environ "1.2.0"]] ``` -------------------------------- ### Set Java System Property for Production Deployment Source: https://github.com/weavejester/environ/blob/master/README.md Illustrates setting a Java system property (e.g., `database.url`) via the command line when running a standalone JAR, which Environ can then pick up. ```Bash java -Ddatabase.url=jdbc:postgresql://localhost/prod -jar standalone.jar ``` -------------------------------- ### Set Environment Variables Programmatically with Boot Environ Source: https://github.com/weavejester/environ/blob/master/README.md Demonstrates how to programmatically set environment variables using the `environ` task within a Boot build pipeline or `task-options!`. ```Clojure (environ :env {:database-url "jdbc:postgresql://localhost/dev"}) ``` -------------------------------- ### Lookup Project Map Keys with Environ Source: https://github.com/weavejester/environ/blob/master/README.md Illustrates how to reference keys from the Leiningen project map (e.g., `:version`) within the `:env` map using a `project` namespace keyword. ```Clojure {:env {:app-version :project/version}} ``` -------------------------------- ### Access Environment Variables with Environ Source: https://github.com/weavejester/environ/blob/master/README.md Demonstrates how to require `environ.core` and access environment variables, such as a database URL, from the `env` map. ```Clojure (require '[environ.core :refer [env]]) (def database-url (env :database-url)) ``` -------------------------------- ### Require Environ Boot Task Source: https://github.com/weavejester/environ/blob/master/README.md After adding the `boot-environ` dependency, require the `environ.boot` namespace to use the `environ` task in your Boot build. ```Clojure (require '[environ.boot :refer [environ]]) ``` -------------------------------- ### Set Environment Variable for Production Deployment Source: https://github.com/weavejester/environ/blob/master/README.md Shows how to set an environment variable (e.g., `DATABASE_URL`) directly in the shell when deploying a standalone JAR for production environments. ```Bash DATABASE_URL=jdbc:postgresql://localhost/prod java -jar standalone.jar ``` -------------------------------- ### Add Leiningen Environ Plugin Source: https://github.com/weavejester/environ/blob/master/README.md To draw settings from the Leiningen project map, add the `lein-environ` plugin to your `project.clj` file. ```Clojure :plugins [[lein-environ "1.2.0"]] ``` -------------------------------- ### Add Environ Dependency to Leiningen Project Source: https://github.com/weavejester/environ/blob/master/README.md Include the Environ library as a dependency in your `project.clj` file for Leiningen projects to enable environment setting management. ```Clojure :dependencies [[environ "1.2.0"]] ``` -------------------------------- ### Create Composite Profiles in project.clj Source: https://github.com/weavejester/environ/blob/master/README.md Shows how to define composite profiles in `project.clj` to ensure that profiles from `profiles.clj` are merged rather than replacing profiles defined in `project.clj`. ```Clojure :profiles {:dev [:project/dev :profiles/dev] :test [:project/test :profiles/test] ;; only edit :profiles/* in profiles.clj :profiles/dev {} :profiles/test {} :project/dev {:source-paths ["src" "tool-src"] :dependencies [[midje "1.6.3"]] :plugins [[lein-auto "0.1.3"]]} :project/test {}} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.