depot/third_party/nixpkgs/pkgs/development/tools/datree/default.nix
Default email b41113241d Project import generated by Copybara.
GitOrigin-RevId: ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90
2022-09-22 14:36:57 +02: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.29";
src = fetchFromGitHub {
owner = "datreeio";
repo = "datree";
rev = version;
hash = "sha256-RFm7I9HTI3M0fdGOz4ZXHtQY4Pm86SOz9pcIQLqb7/U=";
};
vendorSha256 = "sha256-mEtnZO4AZEcnEHuiAWguT8VelD0yLj1rytl6gPkPKBg=";
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";
};
}