1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
let Addon = (./Addon.dhall).Type
let Vault = ./Vault.dhall
let FixedOrRange =
λ(t : Type) → < Fixed : { fixed : t } | Range : { min : t, max : t } >
let fixed = λ(t : Type) → λ(f : t) → (FixedOrRange t).Fixed { fixed = f }
let range = λ(t : Type) → λ(r : { min : t, max : t }) → (FixedOrRange t).Range r
let InstancesConfig = FixedOrRange Natural
let FlavorsConfig = FixedOrRange Text
let ScalingParameters =
{ flavor : Optional FlavorsConfig, instances : Optional InstancesConfig }
let Config =
λ(Environment : Type)
→ { clever_app : Text
, clever_orga : Text
, clever_secret : Text
, clever_token : Text
, clever_syslog_server : Optional Text
, clever_domain : Optional Text
, clever_app_tasks_file : Optional Text
, clever_haskell_entry_point : Optional Text
, clever_disable_metrics : Bool
, clever_addons : List Addon
, clever_env : Environment
, clever_build_flavor : Optional Text
, clever_scaling : Optional ScalingParameters
}
let mkConfig =
λ(vault : Vault)
→ λ(app : Text)
→ λ(organization : Text)
→ { clever_app = app
, clever_orga = organization
, clever_secret = vault.secret
, clever_token = vault.token
, clever_syslog_server = None Text
, clever_domain = None Text
, clever_app_tasks_file = None Text
, clever_haskell_entry_point = None Text
, clever_disable_metrics = False
, clever_addons = [] : List Addon
, clever_env = {=}
, clever_build_flavor = None Text
, clever_scaling = None ScalingParameters
}
: Config {}
in { Type = Config
, mkConfig = mkConfig
, ScalingParameters = ScalingParameters
, InstancesConfig = InstancesConfig
, FlavorsConfig = FlavorsConfig
, fixed = fixed
, range = range
}
|