diff options
author | Hussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com> | 2018-11-19 15:50:51 +0100 |
---|---|---|
committer | Hussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com> | 2018-11-19 18:58:43 +0100 |
commit | 50a9e710f9cff8be9d85d7161bb454a46c3f5734 (patch) | |
tree | 8b566d127eb719a0c3f458f8f80b91a6d75040bc /dhall | |
parent | b570ba036adb74095c712705d686f630d41f4ed0 (diff) | |
download | ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.tar.gz ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.tar.zst ansible-clever-50a9e710f9cff8be9d85d7161bb454a46c3f5734.zip |
add dhall interface
Diffstat (limited to 'dhall')
-rw-r--r-- | dhall/Config.dhall | 26 | ||||
-rw-r--r-- | dhall/Vault.dhall | 1 | ||||
-rw-r--r-- | dhall/addon/Addon.dhall | 1 | ||||
-rw-r--r-- | dhall/addon/Postgresql.dhall | 3 | ||||
-rw-r--r-- | dhall/addon/functions.dhall | 1 | ||||
-rw-r--r-- | dhall/environment/Environment.dhall | 1 | ||||
-rw-r--r-- | dhall/functions.dhall | 1 | ||||
-rw-r--r-- | dhall/mkConfig.dhall | 43 | ||||
-rw-r--r-- | dhall/types.dhall | 9 |
9 files changed, 86 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 | |||
3 | in λ(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 | |||
3 | in 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..a904332 --- /dev/null +++ b/dhall/mkConfig.dhall | |||
@@ -0,0 +1,43 @@ | |||
1 | let Config = ./Config.dhall | ||
2 | |||
3 | in let Vault = ./Vault.dhall | ||
4 | |||
5 | in let Addon = ./addon/Addon.dhall | ||
6 | |||
7 | in let Environment = ./environment/Environment.dhall | ||
8 | |||
9 | in let nonifyEmpty = | ||
10 | λ(opt : Optional Text) | ||
11 | → Optional/fold Text opt Text (λ(x : Text) → x) "None" | ||
12 | |||
13 | in λ(vault : Vault) | ||
14 | → λ(app : Text) | ||
15 | → λ(entryPoint : Text) | ||
16 | → λ(syslogServer : Optional Text) | ||
17 | → λ(domain : Optional Text) | ||
18 | → λ(tasksFile : Optional Text) | ||
19 | → λ(addons : List Addon) | ||
20 | → { clever_app = | ||
21 | app | ||
22 | , clever_orga = | ||
23 | vault.organization | ||
24 | , clever_secret = | ||
25 | vault.secret | ||
26 | , clever_token = | ||
27 | vault.token | ||
28 | , clever_syslog_server = | ||
29 | nonifyEmpty syslogServer | ||
30 | , clever_domain = | ||
31 | nonifyEmpty domain | ||
32 | , clever_app_tasks_file = | ||
33 | nonifyEmpty tasksFile | ||
34 | , clever_entry_point = | ||
35 | entryPoint | ||
36 | , clever_metrics = | ||
37 | True | ||
38 | , clever_addons = | ||
39 | addons | ||
40 | , clever_env = | ||
41 | { FORCE_HTTPS = True } | ||
42 | } | ||
43 | : 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 | } | ||