2022-07-14 12:49:19 +00:00
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
|
pname = "datree";
|
2022-09-22 12:36:57 +00:00
|
|
|
|
version = "1.6.29";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "datreeio";
|
|
|
|
|
repo = "datree";
|
|
|
|
|
rev = version;
|
2022-09-22 12:36:57 +00:00
|
|
|
|
hash = "sha256-RFm7I9HTI3M0fdGOz4ZXHtQY4Pm86SOz9pcIQLqb7/U=";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
|
vendorSha256 = "sha256-mEtnZO4AZEcnEHuiAWguT8VelD0yLj1rytl6gPkPKBg=";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
|
|
ldflags = [
|
2022-07-14 12:49:19 +00:00
|
|
|
|
"-extldflags '-static'"
|
2021-12-06 16:07:01 +00:00
|
|
|
|
"-s"
|
|
|
|
|
"-w"
|
|
|
|
|
"-X github.com/datreeio/datree/cmd.CliVersion=${version}"
|
|
|
|
|
];
|
|
|
|
|
|
2022-07-14 12:49:19 +00: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-06 16:07:01 +00:00
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-07-14 12:49:19 +00:00
|
|
|
|
description =
|
|
|
|
|
"CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organization’s policies";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
homepage = "https://datree.io/";
|
|
|
|
|
license = [ licenses.asl20 ];
|
|
|
|
|
maintainers = [ maintainers.jceb ];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
mainProgram = "datree";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
};
|
|
|
|
|
}
|