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";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "1.8.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "datreeio";
|
|
|
|
repo = "datree";
|
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-dMKRfNGv5BImSjm7zf2bLJw+wWEdVl52IMzCrzJhSHA=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
vendorHash = "sha256-m3O5AoAHSM6rSnmL5N7V37XU38FADb0Edt/EZvvb2u4=";
|
|
|
|
|
|
|
|
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/";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ azahi jceb ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|