From c8f710598541bc594896c962691173c7f2281c58 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Mon, 5 Oct 2020 18:34:59 +0200 Subject: travis: Use encrypted token for slack notifications This commit adds a notification on slack for travis builds. The token is encrypted using the repository key with the `travis` CLI: ``` travis encrypt ":" --add notifications.slack.rooms ``` cf documentation https://docs.travis-ci.com/user/notifications/#configuring-slack-notifications --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 99c10c5..6c68012 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,3 +35,9 @@ script: notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ + slack: + rooms: + - secure: cNAlklFQhu3CRi4Vp+U1veIbSvpAvqVNa0I9knRe8r5Xz6jczuxtKYVnP5m8q1iY38zx3ekjFn+2VdFQgr0twqUYGFMr+YbOWfLdcWxmA6BI29/6kdpoX0uihMEOl5uAyVm7hOiU/DfPxsbQMJeEFY4r/eYM+wErAtFC0c8bWt4oskjJJQPmr7DB/fOaefKkGoVjKElO6goVRWy2fHkGdldvV5EcQPdNW82ZY0w27e7fWm9Yv0D/Jr7Qu9i00UCdT3LyJ05cKVdaxxQOx0xjh+h0V4lN/CRfEBk8LQW3Ror+vnFgQHFkxSzY/MOASBvxZPMj/PFPCP1AwYlxz46dDHnaN2+tNc4Pdj/2qqZPjDW03KqjLRNY3fyfvjX2Yz+2da2hiF7WZReRcFZp0KGxLGTrpFFQ+JOEbYDvK0p4ZswNkDwnI9iYJoI7wntL614y4wIiCRxDR1/aTOGLr+M05WSdBhocL0x8IGVZNKa2yRpcgwlM35QMYSd7QFQmgB6MCIlqHxa1zGg124iepjL1SXp49SwQBI9k1mO4N7z469ZVyEdqydBMMQiiay2mP+fEBAM9gOboV4rMkCSQoMMED+MyiwGRioFor34/t7MQFM18ZoUemQAYRK7iAyCO7JnQOkilAVi+ZIfpiUrrBhBpz5JopeaFEIp4yAuJRyvWD0c= + on_success: change # default: always + on_failure: always # default: always + on_pull_requests: false -- cgit v1.2.3 From ce6889c6f90ba5bc4843afb1f4e321866b324ff6 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Mon, 5 Oct 2020 18:48:57 +0200 Subject: travis: use recent nixpkgs channel (20.09) to install dependencies --- .travis.yml | 21 +++++++++------------ custom.nix | 24 ++++++++++++++++++++++++ default.nix | 11 +++++++++++ dhall-1.34.0.nix | 22 ---------------------- tests/kong.py | 2 +- 5 files changed, 45 insertions(+), 35 deletions(-) create mode 100644 custom.nix create mode 100644 default.nix delete mode 100644 dhall-1.34.0.nix diff --git a/.travis.yml b/.travis.yml index 6c68012..6c36f0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,17 @@ --- language: nix -nix: 2.3.1 +nix: 2.3.4 +env: + - CUSTOM_NIX_PATH=nixpkgs=channel:nixos-20.09 - -# Use the new container infrastructure -sudo: false +# Travis nix integration will install nix AFTER the environment variables are set +# and the nix installer will overide NIX_PATH variable thus we need to re-export it +before_install: + - export NIX_PATH="$CUSTOM_NIX_PATH" install: - # Update nix channels - - nix-channel --add https://nixos.org/channels/nixpkgs-19.09-darwin nixpkgs - - nix-channel --remove nixpkgs-unstable - - nix-channel --update - - # Install ansible - - nix-env -i python3 ansible ansible-lint - - nix-env -if ./dhall-1.34.0.nix + # Install dependencies + - nix-env -i -f ./default.nix # Check ansible version - ansible --version diff --git a/custom.nix b/custom.nix new file mode 100644 index 0000000..f8fe7ce --- /dev/null +++ b/custom.nix @@ -0,0 +1,24 @@ +{ pkgs ? import {} }: with pkgs; + +let + mkDhallVersion = + 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 +{ + dhall = mkDhallVersion "1.34.0" "0n64jkgbv7a3cmlv3gxpgc11p9b5w0k9nc0zm9am2pzmp6vm6b4n"; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..6c1756e --- /dev/null +++ b/default.nix @@ -0,0 +1,11 @@ +{ pkgs ? import {} }: with pkgs; + + let + custom = callPackage ./custom.nix {}; + in +{ + inherit ansible_2_8; + inherit (custom)dhall; + inherit (python38Packages) + ansible-lint; +} diff --git a/dhall-1.34.0.nix b/dhall-1.34.0.nix deleted file mode 100644 index a70d201..0000000 --- a/dhall-1.34.0.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ 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.34.0" "0n64jkgbv7a3cmlv3gxpgc11p9b5w0k9nc0zm9am2pzmp6vm6b4n" diff --git a/tests/kong.py b/tests/kong.py index 32bafb2..4e2df28 100755 --- a/tests/kong.py +++ b/tests/kong.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from http.server import HTTPServer, CGIHTTPRequestHandler -- cgit v1.2.3