aboutsummaryrefslogtreecommitdiffhomepage
path: root/dhall
diff options
context:
space:
mode:
Diffstat (limited to 'dhall')
-rw-r--r--dhall/Config.dhall26
-rw-r--r--dhall/Vault.dhall1
-rw-r--r--dhall/addon/Addon.dhall1
-rw-r--r--dhall/addon/Postgresql.dhall3
-rw-r--r--dhall/addon/functions.dhall1
-rw-r--r--dhall/environment/Environment.dhall1
-rw-r--r--dhall/functions.dhall1
-rw-r--r--dhall/mkConfig.dhall44
-rw-r--r--dhall/types.dhall9
9 files changed, 87 insertions, 0 deletions
diff --git a/dhall/Config.dhall b/dhall/Config.dhall
new file mode 100644
index 0000000..01329a8
--- /dev/null
+++ b/dhall/Config.dhall
@@ -0,0 +1,26 @@
1 let Addon = ./addon/Addon.dhall
2
3in λ(Environment : Type)
4 → { clever_app :
5 Text
6 , clever_orga :
7 Text
8 , clever_secret :
9 Text
10 , clever_token :
11 Text
12 , clever_syslog_server :
13 Text
14 , clever_domain :
15 Text
16 , clever_app_tasks_file :
17 Text
18 , clever_entry_point :
19 Text
20 , clever_metrics :
21 Bool
22 , clever_addons :
23 List Addon
24 , clever_env :
25 Environment
26 }
diff --git a/dhall/Vault.dhall b/dhall/Vault.dhall
new file mode 100644
index 0000000..ba1a309
--- /dev/null
+++ b/dhall/Vault.dhall
@@ -0,0 +1 @@
{ organization : Text, secret : Text, token : Text }
diff --git a/dhall/addon/Addon.dhall b/dhall/addon/Addon.dhall
new file mode 100644
index 0000000..2eb781c
--- /dev/null
+++ b/dhall/addon/Addon.dhall
@@ -0,0 +1 @@
< Postgresql : { name : Text, env_prefix : Text } >
diff --git a/dhall/addon/Postgresql.dhall b/dhall/addon/Postgresql.dhall
new file mode 100644
index 0000000..9dd9744
--- /dev/null
+++ b/dhall/addon/Postgresql.dhall
@@ -0,0 +1,3 @@
1 let addon = constructors ./Addon.dhall
2
3in addon.Postgresql { name = "pg", env_prefix = "POSTGRESQL_ADDON" }
diff --git a/dhall/addon/functions.dhall b/dhall/addon/functions.dhall
new file mode 100644
index 0000000..65979ac
--- /dev/null
+++ b/dhall/addon/functions.dhall
@@ -0,0 +1 @@
{ Postgresql = ./Postgresql.dhall }
diff --git a/dhall/environment/Environment.dhall b/dhall/environment/Environment.dhall
new file mode 100644
index 0000000..68514c9
--- /dev/null
+++ b/dhall/environment/Environment.dhall
@@ -0,0 +1 @@
{ FORCE_HTTPS : Bool }
diff --git a/dhall/functions.dhall b/dhall/functions.dhall
new file mode 100644
index 0000000..f047c19
--- /dev/null
+++ b/dhall/functions.dhall
@@ -0,0 +1 @@
{ Addon = ./addon/functions.dhall, mkConfig = ./mkConfig.dhall }
diff --git a/dhall/mkConfig.dhall b/dhall/mkConfig.dhall
new file mode 100644
index 0000000..5040f1c
--- /dev/null
+++ b/dhall/mkConfig.dhall
@@ -0,0 +1,44 @@
1 let Config = ./Config.dhall
2
3in let Vault = ./Vault.dhall
4
5in let Addon = ./addon/Addon.dhall
6
7in let Environment = ./environment/Environment.dhall
8
9in let nonifyEmpty =
10 λ(opt : Optional Text)
11 → Optional/fold Text opt Text (λ(x : Text) → x) "None"
12
13in λ(vault : Vault)
14 → λ(app : Text)
15 → λ(entryPoint : Text)
16 → λ(metrics : Bool)
17 → λ(syslogServer : Optional Text)
18 → λ(domain : Optional Text)
19 → λ(tasksFile : Optional Text)
20 → λ(addons : List Addon)
21 → { clever_app =
22 app
23 , clever_orga =
24 vault.organization
25 , clever_secret =
26 vault.secret
27 , clever_token =
28 vault.token
29 , clever_syslog_server =
30 nonifyEmpty syslogServer
31 , clever_domain =
32 nonifyEmpty domain
33 , clever_app_tasks_file =
34 nonifyEmpty tasksFile
35 , clever_entry_point =
36 entryPoint
37 , clever_metrics =
38 metrics
39 , clever_addons =
40 addons
41 , clever_env =
42 { FORCE_HTTPS = True }
43 }
44 : Config Environment
diff --git a/dhall/types.dhall b/dhall/types.dhall
new file mode 100644
index 0000000..5e6a81c
--- /dev/null
+++ b/dhall/types.dhall
@@ -0,0 +1,9 @@
1{ Vault =
2 ./Vault.dhall
3, Addon =
4 ./addon/Addon.dhall
5, Environment =
6 ./environment/Environment.dhall
7, Config =
8 ./Config.dhall
9}