duct

val_waeselynck 2020-06-12T19:38:25.117700Z

Is it possible to define custom profiles in Duct? My use case is that I'd like to have several variants of dev profiles.

kwrooijen 2020-06-12T19:52:46.118200Z

You can add profiles in dev.clj

kwrooijen 2020-06-12T19:53:13.118800Z

But they need to drive from :duct/profile iirc

kwrooijen 2020-06-13T12:19:01.132Z

In your duct_hierarchy.edn you can add the following:

{:myapp.profile/dev [:duct/profile]}
This will make sure that :myapp.profile/dev is derived from :duct/profile. Next, in your dev.clj file, you will want to add this new profile:
(def profiles
  [:myapp.profile/dev :duct.profile/dev :duct.profile/local])
And finally, you will want to include it in your config:
:myapp.profile/dev #duct/include "myapp/my-dev.edn"
Does this help?

val_waeselynck 2020-06-13T12:26:46.132200Z

Thanks, it's strange because I'm fairly sure I tried that... let me try again.

kwrooijen 2020-06-13T12:28:17.132400Z

This is wat we currently use at work, I don't think I skipped any steps. We use this to include profiles from dependency libraries

val_waeselynck 2020-06-13T13:57:38.132600Z

OK it worked, thanks @kevin.van.rooijen! I don't know what I did wrong the 1st time I tried that.

kwrooijen 2020-06-13T13:57:57.132800Z

Good to hear! Glad it's working now 🙂

2020-06-16T11:22:19.133Z

we do this extensively; there are some gotchas to do with resolution order of profiles though… they don’t currently happen in the order specified by that profiles vector; but by their own dependency order with ties resolved alphabetically

2020-06-16T11:22:58.133300Z

This is something I’d like for duct to change

kwrooijen 2020-06-16T11:23:18.133500Z

Yeah, ordering in Duct is a bit of an issue. Same problem with Ataraxy middleware (although that's an Ataraxy issue, not Duct)

kwrooijen 2020-06-16T11:23:47.133700Z

The Duct configuration should get a bit of a revamp before 1.0 though. Would be nice to fix these things by then