nixpkgs/pkgs/development/tools/datree/default.nix

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

59 lines
1.5 KiB
Nix
Raw Normal View History

2022-11-10 22:54:11 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, datree
}:
2021-12-01 09:12:11 +00:00
buildGoModule rec {
pname = "datree";
2023-02-20 19:25:47 +00:00
version = "1.8.24";
2021-12-01 09:12:11 +00:00
src = fetchFromGitHub {
owner = "datreeio";
repo = "datree";
2023-01-07 22:03:07 +00:00
rev = "refs/tags/${version}";
2023-02-20 19:25:47 +00:00
hash = "sha256-C6APYGe0zLj/SYaSOoYKr/4yyAs0EKJmDfcJlqltKdg=";
2021-12-01 09:12:11 +00:00
};
2023-01-07 18:28:15 +00:00
vendorHash = "sha256-mkVguYzjNGgFUdATjGfenCx3h97LS3SEOkYo3CuP9fA=";
2022-11-10 22:54:11 +00:00
nativeBuildInputs = [ installShellFiles ];
2021-12-01 09:12:11 +00:00
ldflags = [
"-s"
"-w"
"-X github.com/datreeio/datree/cmd.CliVersion=${version}"
];
2022-11-10 22:54:11 +00:00
tags = [ "main" ];
2022-05-10 09:20:18 +00:00
postInstall = ''
2022-11-10 22:54:11 +00:00
installShellCompletion \
--cmd datree \
--bash <($out/bin/datree completion bash) \
--fish <($out/bin/datree completion fish) \
--zsh <($out/bin/datree completion zsh)
2022-05-10 09:20:18 +00:00
'';
2022-11-10 22:54:11 +00:00
passthru.tests.version = testers.testVersion {
package = datree;
command = "datree version";
};
2021-12-01 09:12:11 +00:00
meta = with lib; {
2022-11-10 22:54:11 +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-01 09:12:11 +00:00
homepage = "https://datree.io/";
2023-01-07 22:03:07 +00:00
changelog = "https://github.com/datreeio/datree/releases/tag/${version}";
2022-11-10 22:54:11 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ azahi jceb ];
2021-12-01 09:12:11 +00:00
};
}