This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-26
Channels
- # announcements (9)
- # babashka (36)
- # beginners (13)
- # biff (24)
- # calva (12)
- # clj-kondo (18)
- # clojure (33)
- # clojure-brasil (1)
- # clojure-europe (11)
- # clojure-nl (1)
- # clojure-norway (87)
- # clojure-uk (4)
- # clojurescript (28)
- # datahike (25)
- # fulcro (12)
- # hyperfiddle (16)
- # malli (74)
- # missionary (1)
- # music (2)
- # off-topic (24)
- # polylith (4)
- # releases (3)
- # tools-deps (23)
This might be a silly question, but I don’t see any documentation on how to set environment variables for local development (i.e. workspace
?). With Leiningen and Boot, there is environ
library which I was hoping to be able to use with Polylith. Maybe I have an incorrect mental model and the approach within polylith projects is different. Is it possible to set environment variables that are accessible from environ
within the deps.edn
or workspace
configuration for use in local development? Is that something that one should even want to do with polylith? If not, how does polylith approach 12 factor application development in the context of developer experience?
Polylith doesn't prescribe or restrict anything, here.
I myself use environment variables (for my deployed projects), in conjunction with integrant
and aero
which together allow me to specify #env SOME_ENV_NAME
in my integrant configs.
Seems environ
works similarly though it appears more geared to lein and boot, as well as simple env variables. Polylith projects use deps.edn
instead, so you'll have to make do with environment variables. Set them then launch your REPL before connecting to it, rather than launching the REPL from cider or calva with the jack-in command.
I was unaware of aero
. I like its design better then environ
and will be using it. Thank you!
Sure, no prob!
Also a small clarification on my setup:
I have quite a few system.edn
files.. the one in development/resources
is the one that is read when I work at the REPL, using functions in development/src/user.clj
This one does not make use of env variables (anymore), as this system.edn
file is not checked into git anyway. When I first started I would have env vars in there but got annoyed at having to set them up before launching my REPL.
The project-specific system.edn
files however do make use of env vars, as I explained above.