duct

vemv 2024-02-27T11:03:47.236229Z

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

2024-02-28T09:32:46.191349Z

My understanding is that you use local.edn for your local settings - https://github.com/duct-framework/duct/wiki/Configuration#localedn https://github.com/duct-framework/core?tab=readme-ov-file#profiles

vemv 2024-02-28T12:53:36.753969Z

Yes, but I need even more fine-grainedness

2024-02-28T13:10:05.833909Z

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.

vemv 2024-02-28T13:21:08.470679Z

Maybe! Might play with them

ts1503 2024-03-01T09:50:59.644069Z

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

ts1503 2024-03-01T09:53:14.195489Z

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)))

ts1503 2024-03-01T09:54:24.353379Z

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