From f9de76b5e2f85e7400509ff936ba259f848074d8 Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Tue, 10 May 2022 11:20:18 +0200 Subject: [PATCH] datree: 0.15.22 -> 1.5.25 --- pkgs/development/tools/datree/default.nix | 27 ++++++++++++++++++----- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/datree/default.nix b/pkgs/development/tools/datree/default.nix index e94917f15d7c..84b53a08c67d 100644 --- a/pkgs/development/tools/datree/default.nix +++ b/pkgs/development/tools/datree/default.nix @@ -1,30 +1,47 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "datree"; - version = "0.15.22"; + version = "1.5.25"; src = fetchFromGitHub { owner = "datreeio"; repo = "datree"; rev = version; - hash = "sha256-g5u2QQtVmNp01KtUKwC8uoEIuoBDLHsOlRz1Mv0n/y8="; + hash = "sha256-OB5o/ouA6a2/OUnhibTKYCskCFmJIuDcXLrNTNWtNEQ="; }; - vendorSha256 = "1cvlvlwdk41f145kzifg7rv7ymwhc9k0ck91bn106240rq1igcr0"; + vendorSha256 = "sha256-6Ve7Ui90KHsFwRs6/uyjqHgRY6U7zFWijSFcVuOXdEM="; ldflags = [ + "-extldflags '-static'" "-s" "-w" "-X github.com/datreeio/datree/cmd.CliVersion=${version}" ]; + nativeBuildInputs = [ installShellFiles ]; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/datree version | grep ${version} > /dev/null + ''; + + postInstall = '' + for shell in bash fish zsh; do + $out/bin/datree completion $shell > datree.$shell + installShellCompletion datree.$shell + done + ''; + doCheck = true; meta = with lib; { - description = "CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organization’s policies"; + description = + "CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organization’s policies"; homepage = "https://datree.io/"; license = [ licenses.asl20 ]; maintainers = [ maintainers.jceb ]; + mainProgram = "datree"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a475cee96b9a..89b61a52dbc2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15603,7 +15603,9 @@ with pkgs; cli11 = callPackage ../development/tools/misc/cli11 { }; - datree = callPackage ../development/tools/datree { }; + datree = callPackage ../development/tools/datree { + buildGoModule = buildGo118Module; + }; dcadec = callPackage ../development/tools/dcadec { };