2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, testers
|
|
|
|
, datree
|
|
|
|
}:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "datree";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "1.8.33";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "datreeio";
|
|
|
|
repo = "datree";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-pyu8umkR8ncDVkSLJbxqnLFRlZQR29GnkCSxDNHQUGg=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
vendorHash = "sha256-mkVguYzjNGgFUdATjGfenCx3h97LS3SEOkYo3CuP9fA=";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/datreeio/datree/cmd.CliVersion=${version}"
|
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
tags = [ "main" ];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
installShellCompletion \
|
|
|
|
--cmd datree \
|
|
|
|
--bash <($out/bin/datree completion bash) \
|
|
|
|
--fish <($out/bin/datree completion fish) \
|
|
|
|
--zsh <($out/bin/datree completion zsh)
|
2022-07-14 12:49:19 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = datree;
|
|
|
|
command = "datree version";
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-11-21 17:40:18 +00:00
|
|
|
description = "CLI tool to ensure K8s manifests and Helm charts follow best practices";
|
|
|
|
longDescription = ''
|
|
|
|
Datree provides an E2E policy enforcement solution to run automatic checks
|
|
|
|
for rule violations. Datree can be used on the command line, admission
|
|
|
|
webhook, or even as a kubectl plugin to run policies against Kubernetes
|
|
|
|
objects.
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://datree.io/";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/datreeio/datree/releases/tag/${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ azahi jceb ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|