From 331e852ca9f795818b7dcbb85d782dfff32c4ea2 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Fri, 26 Apr 2019 18:06:35 +0200 Subject: dhall(upgrade): upgrade code to be compatible with dhall 1.21.0 --- .travis.yml | 2 +- dhall-1.18.0.nix | 16 ---------- dhall-1.21.0.nix | 22 ++++++++++++++ dhall/server/service/plugin/CorrelationId.dhall | 16 +++++----- dhall/server/service/plugin/mkIPRestriction.dhall | 16 +++++----- .../service/plugin/mkRequestTermination.dhall | 34 +++++++++++----------- .../service/plugin/mkRequestTransformer.dhall | 16 +++++----- 7 files changed, 64 insertions(+), 58 deletions(-) delete mode 100644 dhall-1.18.0.nix create mode 100644 dhall-1.21.0.nix diff --git a/.travis.yml b/.travis.yml index f18b9b3..029c1a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ sudo: false install: # Install ansible - nix-env -i python2.7-ansible python2.7-ansible-lint - - nix-env -if ./dhall-1.18.0.nix + - nix-env -if ./dhall-1.21.0.nix # Check ansible version - ansible --version diff --git a/dhall-1.18.0.nix b/dhall-1.18.0.nix deleted file mode 100644 index d6522bd..0000000 --- a/dhall-1.18.0.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs ? import {} }: 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/ - ''; -} diff --git a/dhall-1.21.0.nix b/dhall-1.21.0.nix new file mode 100644 index 0000000..e53369b --- /dev/null +++ b/dhall-1.21.0.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: with pkgs; + +let + mkVersion = + version: sha256: + stdenv.mkDerivation { + name = "dhall-${version}"; + inherit version; + src = fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2"; + inherit sha256; + }; + unpackPhase = '' + tar -xjf $src + ''; + installPhase = '' + mkdir -p $out/bin + mv bin/dhall $out/bin/ + ''; + }; +in + mkVersion "1.21.0" "0x7q6v1y62fq6724kx1hcfp1fcqv3lbv33ji6jzfd5y316a31r77" diff --git a/dhall/server/service/plugin/CorrelationId.dhall b/dhall/server/service/plugin/CorrelationId.dhall index d96bfc9..655cd8d 100644 --- a/dhall/server/service/plugin/CorrelationId.dhall +++ b/dhall/server/service/plugin/CorrelationId.dhall @@ -1,11 +1,11 @@ - let Plugin = ./Plugin.dhall +let Plugin = ./Plugin.dhall -in let config = constructors ./Config.dhall +let config = ./Config.dhall in { name = - "correlation-id" - , config = - config.CorrelationId - { header_name = "X-correl", echo_downstream = True } - } - : Plugin + "correlation-id" + , config = + config.CorrelationId + { header_name = "X-correl", echo_downstream = True } + } + : Plugin diff --git a/dhall/server/service/plugin/mkIPRestriction.dhall b/dhall/server/service/plugin/mkIPRestriction.dhall index f803769..a27e5d9 100644 --- a/dhall/server/service/plugin/mkIPRestriction.dhall +++ b/dhall/server/service/plugin/mkIPRestriction.dhall @@ -1,11 +1,11 @@ - let Plugin = ./Plugin.dhall +let Plugin = ./Plugin.dhall -in let config = constructors ./Config.dhall +let config = ./Config.dhall in λ(whiteList : Text) - → { name = - "ip-restriction" - , config = - config.IPRestriction { whitelist = whiteList } - } - : Plugin + → { name = + "ip-restriction" + , config = + config.IPRestriction { whitelist = whiteList } + } + : Plugin diff --git a/dhall/server/service/plugin/mkRequestTermination.dhall b/dhall/server/service/plugin/mkRequestTermination.dhall index aff538f..1d047d7 100644 --- a/dhall/server/service/plugin/mkRequestTermination.dhall +++ b/dhall/server/service/plugin/mkRequestTermination.dhall @@ -1,20 +1,20 @@ - let Plugin = ./Plugin.dhall +let Plugin = ./Plugin.dhall -in let config = constructors ./Config.dhall +let config = ./Config.dhall in λ(statusCode : Natural) - → λ(contentType : Text) - → λ(body : Text) - → { name = - "request-termination" - , config = - config.RequestTermination - { status_code = - statusCode - , content_type = - contentType - , body = - body - } - } - : Plugin + → λ(contentType : Text) + → λ(body : Text) + → { name = + "request-termination" + , config = + config.RequestTermination + { status_code = + statusCode + , content_type = + contentType + , body = + body + } + } + : Plugin diff --git a/dhall/server/service/plugin/mkRequestTransformer.dhall b/dhall/server/service/plugin/mkRequestTransformer.dhall index 1d8d608..488ecdd 100644 --- a/dhall/server/service/plugin/mkRequestTransformer.dhall +++ b/dhall/server/service/plugin/mkRequestTransformer.dhall @@ -1,11 +1,11 @@ let Plugin = ./Plugin.dhall -in let config = constructors ./Config.dhall +let config = ./Config.dhall - in λ(header : Text) - → { name = - "request-transformer" - , config = - config.RequestTransformer { add = { headers = [ header ] } } - } - : Plugin \ No newline at end of file +in λ(header : Text) + → { name = + "request-transformer" + , config = + config.RequestTransformer { add = { headers = [ header ] } } + } + : Plugin -- cgit v1.2.3