This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-27
Channels
- # aleph (5)
- # announcements (18)
- # beginners (200)
- # cider (25)
- # cljdoc (4)
- # cljsrn (3)
- # clojure (90)
- # clojure-europe (3)
- # clojure-finland (5)
- # clojure-france (1)
- # clojure-houston (1)
- # clojure-italy (8)
- # clojure-nl (15)
- # clojure-spec (24)
- # clojure-uk (20)
- # clojurescript (199)
- # core-async (2)
- # cursive (45)
- # data-science (14)
- # datomic (33)
- # duct (13)
- # fulcro (4)
- # graphql (3)
- # kaocha (9)
- # leiningen (24)
- # nrepl (16)
- # off-topic (105)
- # pathom (15)
- # pedestal (28)
- # re-frame (1)
- # reagent (14)
- # shadow-cljs (28)
- # spacemacs (8)
- # tools-deps (8)
- # vim (4)
Hi all, is there any documentation on how duct.profile keys work? e.g. :duct.profile/local
. Can I create more profiles and can I switch between profiles in the repl?
There is not so much documentation available, but you can read the code.
(defn -main [& args]
(let [keys (or (duct/parse-keys args) [:duct/daemon])
profiles [:duct.profile/prod]]
(-> (duct/resource "film_ratings/config.edn")
(duct/read-config)
(duct/exec-config profiles keys)))) ; Heres the entry point for production profile
If you look into dev/src/dev.clj
(def profiles
[:duct.profile/dev :duct.profile/local])
...
(integrant.repl/set-prep! #(duct/prep-config (read-config) profiles)) ; here we change the prep fn and use profiles defined above
When you call (go)
the code will call (prep)
and then (init)
https://github.com/weavejester/integrant-repl/blob/89a9552fd3623976b83318a5f8f903f1ebeda2f7/src/integrant/repl.clj#L53
(prep)
will change config https://github.com/weavejester/integrant-repl/blob/89a9552fd3623976b83318a5f8f903f1ebeda2f7/src/integrant/repl.clj#L14