3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/datree/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
Nix
Raw Normal View History

2022-05-10 10:20:18 +01:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2021-12-01 09:12:11 +00:00
buildGoModule rec {
pname = "datree";
2022-10-25 14:30:11 +01:00
version = "1.6.42";
2021-12-01 09:12:11 +00:00
src = fetchFromGitHub {
owner = "datreeio";
repo = "datree";
rev = version;
2022-10-25 14:30:11 +01:00
hash = "sha256-4sj+zyFYtG/C6oDuQno/rkyxgdnnvAn9GZ5qvqA+UhA=";
2021-12-01 09:12:11 +00:00
};
2022-09-20 08:14:58 +01:00
vendorSha256 = "sha256-gjD24nyQ8U1WwhUbq8N4dvzFK74t3as7wWZK7rh9yiw=";
2021-12-01 09:12:11 +00:00
ldflags = [
2022-05-10 10:20:18 +01:00
"-extldflags '-static'"
2021-12-01 09:12:11 +00:00
"-s"
"-w"
"-X github.com/datreeio/datree/cmd.CliVersion=${version}"
];
2022-05-10 10:20:18 +01:00
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
'';
2021-12-01 09:12:11 +00:00
doCheck = true;
meta = with lib; {
2022-05-10 10:20:18 +01:00
description =
"CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organizations policies";
2021-12-01 09:12:11 +00:00
homepage = "https://datree.io/";
license = [ licenses.asl20 ];
maintainers = [ maintainers.jceb ];
2022-05-10 10:20:18 +01:00
mainProgram = "datree";
2021-12-01 09:12:11 +00:00
};
}