2020-12-19 15:46:56 +00:00
|
|
|
{ stdenv, lib, buildPackages, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform;
|
2018-11-27 01:35:48 +00:00
|
|
|
|
2020-12-19 15:46:56 +00:00
|
|
|
in
|
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "stern";
|
2021-08-18 01:56:42 +00:00
|
|
|
version = "1.20.0";
|
2018-10-01 21:56:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-12-19 15:46:56 +00:00
|
|
|
owner = "stern";
|
2018-10-01 21:56:08 +00:00
|
|
|
repo = "stern";
|
2020-12-19 15:46:56 +00:00
|
|
|
rev = "v${version}";
|
2021-08-18 01:56:42 +00:00
|
|
|
sha256 = "sha256-y8FkQBZHg4LYC8CmwQSg2oZjIrlY30tL/OkfnT+XsMM=";
|
2018-10-01 21:56:08 +00:00
|
|
|
};
|
|
|
|
|
2021-08-18 01:56:42 +00:00
|
|
|
vendorSha256 = "sha256-217OKXT072hpq4a6JEev4rSR8uUoPdDbOR7KUkhpM9E=";
|
2021-06-30 04:40:51 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2018-10-01 21:56:08 +00:00
|
|
|
|
2020-04-26 03:16:52 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-12-19 15:46:56 +00:00
|
|
|
buildFlagsArray =
|
|
|
|
[ "-ldflags=-s -w -X github.com/stern/stern/cmd.version=${version}" ];
|
|
|
|
|
2018-11-27 01:35:48 +00:00
|
|
|
postInstall =
|
2020-12-19 15:46:56 +00:00
|
|
|
let stern = if isCrossBuild then buildPackages.stern else "$out";
|
|
|
|
in
|
2018-11-27 01:35:48 +00:00
|
|
|
''
|
2020-04-26 03:16:52 +00:00
|
|
|
for shell in bash zsh; do
|
|
|
|
${stern}/bin/stern --completion $shell > stern.$shell
|
|
|
|
installShellCompletion stern.$shell
|
|
|
|
done
|
2018-11-27 01:35:48 +00:00
|
|
|
'';
|
2018-11-26 19:41:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-12-19 15:46:56 +00:00
|
|
|
description = "Multi pod and container log tailing for Kubernetes";
|
|
|
|
homepage = "https://github.com/stern/stern";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ mbode preisschild ];
|
|
|
|
platforms = platforms.unix;
|
2018-11-26 19:41:04 +00:00
|
|
|
};
|
2018-10-01 21:56:08 +00:00
|
|
|
}
|