I have a question regarding of the usage of profiles and environment variables. Is it possible to export variables with environ depending on the which profile is set? This is what I have tried (partial project.clj)
:env {:time-to-wait-for-response "72" ; in hours
:crm-address "https://app.onepagecrm.com/api/v3/"}
:profiles
{:uberjar {:omit-source true
:aot :all}
:uberwar {:omit-source true
:aot :all}
:prod {:ring {:open-browser? false
:stacktraces? false
:auto-reload? false}
{:env {:prod? true
:db-user "mailer"
:db-password "" }}
:dev {:env {:db-user "mailer"
:db-password ""}
:dependencies [[ring-mock "0.1.5"]
[ring/ring-devel "1.3.1"]
[midje "1.6.3"]]
:ring {:open-browser? false}
:plugins [[lein-midje "3.2.1"]]}})
However if I build the WAR file with lein ring uberwar(even with with-profile dev) and deploy it to Tomcat I will get db-user as nil (called with (env :db-user). However lein ring server correctly uses dev profile so it works. Is there something wrong I am doing? Or environ is not supposed to be used this way?