Skip to content

Commit

Permalink
Add inital proposal for pack.alpha.edn
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereOverfl0w committed Mar 30, 2018
1 parent 952541a commit f8d2463
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docs/adr/001-input.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
= ADR: How to input config

== Context

Pack needs arguments in order to build it's outputs.
This configuration quantity varies in quantity.

For AWS Lambda, there is very little configuration:

* deps.edn location
* output jar location
* build-dir

For Capsule there is quite a lot:

* JVM args
* environment variable overrides
* system properties
* min-java-version
* application version
* application-id

Attributes fall into categories:

* Runtime known, e.g. application-version
* Permanent, e.g. application-id
* Context-specific, e.g. JVM args

There is also the special category "deps.edn", which is a file path.
It's currently relative to the cwd.

You lose the ability to run `clj -m pack.main app/deps.edn` in order to share deps.edn configs at all times.
This suggests to me that it's probably useful to have some way to override properties via the CLI.
I'm not sure if this should extend to _any_ property, `merge`, or specific properties (following the aero principles).

== Decision

Read a edn file to get config.

Command line options will exist for:

* Providing CLI flags to the edn file
* Specifying a profile (mandatory)
* Specifying a pack.alpha.edn location, defaulting to $cwd/pack.alpha.edn

Create an aero-like set of readers.
The following readers will exist:

* `#pack/cli` for loading options from the command-line.
* `#pack/env` for reading an environment variable.
* `#pack/profile` for performing a `case` on the profile.

== Status

Proposed

== Consequences

* Specifying non-string properties from env/cli is not possible

0 comments on commit f8d2463

Please sign in to comment.