duct 2024-02-27

How to make custom profiles? e.g. I want :test-ci or :test-local profiles, that tweak specific aspects of the :test profile for CI and local ("laptop") testing respectively

Yes, but I need even more fine-grainedness

I'm not completely sure but perhaps a "module" is what you're looking for? > Duct modules are like profiles, in the sense that they change the base configuration. The difference is that modules are functions which take a base config and return a base config. Whereas profiles simply merge maps depending on the environment.

Maybe! Might play with them

I think you can include as much profiles as you want in the config.edn file. Then you can control which you want to activate in the starting point

here’s a standard main function

(defn -main [& args]
  (let [keys     (or (duct/parse-keys args) [:duct/daemon])
        profiles [:duct.profile/prod]]
    (-> (duct/resource "config.edn")
        (duct/read-config)
        (duct/exec-config profiles keys))
    (System/exit 0)))

if you change profiles [:duct.profile/prod] to read from args or from environment variable you can pick specific profiles for different scenario