depot/third_party/nixpkgs/pkgs/development/tools/datree/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

47 lines
1.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "datree";
version = "1.6.42";
src = fetchFromGitHub {
owner = "datreeio";
repo = "datree";
rev = version;
hash = "sha256-4sj+zyFYtG/C6oDuQno/rkyxgdnnvAn9GZ5qvqA+UhA=";
};
vendorSha256 = "sha256-gjD24nyQ8U1WwhUbq8N4dvzFK74t3as7wWZK7rh9yiw=";
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 organizations policies";
homepage = "https://datree.io/";
license = [ licenses.asl20 ];
maintainers = [ maintainers.jceb ];
mainProgram = "datree";
};
}