]> git.immae.eu Git - github/fretlink/ansible-clever.git/commitdiff
add travis ci step for typechecking dhall
authorHussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com>
Mon, 19 Nov 2018 17:57:33 +0000 (18:57 +0100)
committerHussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com>
Tue, 20 Nov 2018 10:44:59 +0000 (11:44 +0100)
.travis.yml
dhall-1.18.nix [new file with mode: 0644]
dhall/mkConfig.dhall
scripts/dhall_check.sh

index 82ddcec925c12bcee6327c1a0a55a11664418338..ef53f71de7ed9fd351075580f81190f9127a2a3a 100644 (file)
@@ -6,6 +6,7 @@ sudo: false
 install:
   - nix-env -i python2.7-ansible
   - nix-env -i python2.7-ansible-lint
+  - nix-env -if ./dhall-1.18.nix
 
   # Check ansible version
   - ansible --version
@@ -20,6 +21,7 @@ script:
   # Basic role syntax check
   - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
   - ansible-lint .
+  - scripts/dhall_check.sh
 
 notifications:
   slack: fretlink:pTIylIN7zkwRFuL3aHERmsbB
diff --git a/dhall-1.18.nix b/dhall-1.18.nix
new file mode 100644 (file)
index 0000000..d6522bd
--- /dev/null
@@ -0,0 +1,16 @@
+{ pkgs ? import <nixpkgs> {} }: with pkgs;
+
+stdenv.mkDerivation rec {
+  name = "dhall-${version}";
+  version = "1.18.0";
+  phases = [ "installPhase "];
+  src = fetchurl {
+    url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2";
+    sha256 = "0jvw6ss96xifb21mzpvfjzvaffcnpj0jhpc4rd36cl2r22800qgx";
+  };
+  installPhase = ''
+    mkdir -p $out/bin
+    tar -xjf $src
+    mv bin/dhall $out/bin/
+  '';
+}
index a904332d30aafd9c43bb9186f6ca1b0ee8ca89f3..5040f1c6e28ef64dec7e016b3897761cd878be85 100644 (file)
@@ -13,6 +13,7 @@ in  let nonifyEmpty =
 in    λ(vault : Vault)
     → λ(app : Text)
     → λ(entryPoint : Text)
+    → λ(metrics : Bool)
     → λ(syslogServer : Optional Text)
     → λ(domain : Optional Text)
     → λ(tasksFile : Optional Text)
@@ -34,7 +35,7 @@ in    λ(vault : Vault)
         , clever_entry_point =
             entryPoint
         , clever_metrics =
-            True
+            metrics
         , clever_addons =
             addons
         , clever_env =
index 009d57021e427e6ca4326fc7e443b4c87930c6bc..a3413ec97662bc8a3fc0839107f0253e66e83dcf 100755 (executable)
@@ -13,6 +13,7 @@ go() {
   for file in $(find -type f -name "*.dhall"); do
     pushd $(dirname $file);
     cat $(basename $file) | dhall --explain resolve > /dev/null;
+    echo "Typechecking ${file}"
     if [ "$?" -ne "0" ]; then
       echo "Failed to resolve $file"
       ERROR=1;