diff options
Diffstat (limited to 'dhall/Config.dhall')
-rw-r--r-- | dhall/Config.dhall | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/dhall/Config.dhall b/dhall/Config.dhall index e092e2c..12371f5 100644 --- a/dhall/Config.dhall +++ b/dhall/Config.dhall | |||
@@ -2,6 +2,20 @@ let Addon = (./Addon.dhall).Type | |||
2 | 2 | ||
3 | let Vault = ./Vault.dhall | 3 | let Vault = ./Vault.dhall |
4 | 4 | ||
5 | let FixedOrRange = | ||
6 | λ(t : Type) → < Fixed : { fixed : t } | Range : { min : t, max : t } > | ||
7 | |||
8 | let fixed = λ(t : Type) → λ(f : t) → (FixedOrRange t).Fixed { fixed = f } | ||
9 | |||
10 | let range = λ(t : Type) → λ(r : { min : t, max : t }) → (FixedOrRange t).Range r | ||
11 | |||
12 | let InstancesConfig = FixedOrRange Natural | ||
13 | |||
14 | let FlavorsConfig = FixedOrRange Text | ||
15 | |||
16 | let ScalingParameters = | ||
17 | { flavor : Optional FlavorsConfig, instances : Optional InstancesConfig } | ||
18 | |||
5 | let Config = | 19 | let Config = |
6 | λ(Environment : Type) | 20 | λ(Environment : Type) |
7 | → { clever_app : Text | 21 | → { clever_app : Text |
@@ -16,6 +30,7 @@ let Config = | |||
16 | , clever_addons : List Addon | 30 | , clever_addons : List Addon |
17 | , clever_env : Environment | 31 | , clever_env : Environment |
18 | , clever_build_flavor : Optional Text | 32 | , clever_build_flavor : Optional Text |
33 | , clever_scaling : Optional ScalingParameters | ||
19 | } | 34 | } |
20 | 35 | ||
21 | let mkConfig = | 36 | let mkConfig = |
@@ -34,7 +49,15 @@ let mkConfig = | |||
34 | , clever_addons = [] : List Addon | 49 | , clever_addons = [] : List Addon |
35 | , clever_env = {=} | 50 | , clever_env = {=} |
36 | , clever_build_flavor = None Text | 51 | , clever_build_flavor = None Text |
52 | , clever_scaling = None ScalingParameters | ||
37 | } | 53 | } |
38 | : Config {} | 54 | : Config {} |
39 | 55 | ||
40 | in { Type = Config, mkConfig = mkConfig } | 56 | in { Type = Config |
57 | , mkConfig = mkConfig | ||
58 | , ScalingParameters = ScalingParameters | ||
59 | , InstancesConfig = InstancesConfig | ||
60 | , FlavorsConfig = FlavorsConfig | ||
61 | , fixed = fixed | ||
62 | , range = range | ||
63 | } | ||