2020-08-13 08:22:34 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "tektoncd-cli";
|
2022-06-07 12:48:38 +00:00
|
|
|
version = "0.24.0";
|
2020-08-13 08:22:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tektoncd";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2022-06-07 12:48:38 +00:00
|
|
|
sha256 = "sha256-mrTtg60LZpRONrEhX53EhSYpfdfGMvPK4WhTHeAKsoQ=";
|
2020-08-13 08:22:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
2021-07-14 21:19:35 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}" ];
|
2020-08-13 08:22:34 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-02-12 19:50:36 +00:00
|
|
|
# third_party/VENDOR-LICENSE breaks build/check as go files are still included
|
|
|
|
# docs is a tool for generating docs
|
2022-02-26 15:01:37 +00:00
|
|
|
excludedPackages = [ "third_party" "cmd/docs" ];
|
2020-08-13 08:22:34 +00:00
|
|
|
|
2021-02-12 19:50:36 +00:00
|
|
|
preCheck = ''
|
2022-01-31 16:00:23 +00:00
|
|
|
# some tests try to write to the home dir
|
2021-04-27 16:48:42 +00:00
|
|
|
export HOME="$TMPDIR"
|
2022-01-31 16:00:23 +00:00
|
|
|
|
|
|
|
# the tests expect the clientVersion ldflag not to be set
|
|
|
|
unset ldflags
|
|
|
|
|
|
|
|
# remove tests with networking
|
|
|
|
rm pkg/cmd/version/version_test.go
|
2021-02-12 19:50:36 +00:00
|
|
|
'';
|
2020-08-13 08:22:34 +00:00
|
|
|
|
2021-02-12 19:50:36 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage docs/man/man1/*
|
2020-08-13 08:22:34 +00:00
|
|
|
|
2020-11-16 21:36:24 +00:00
|
|
|
installShellCompletion --cmd tkn \
|
|
|
|
--bash <($out/bin/tkn completion bash) \
|
|
|
|
--fish <($out/bin/tkn completion fish) \
|
|
|
|
--zsh <($out/bin/tkn completion zsh)
|
2020-08-13 08:22:34 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-13 00:01:09 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
$out/bin/tkn --help
|
2021-07-14 21:19:35 +00:00
|
|
|
$out/bin/tkn version | grep "Client version: ${version}"
|
2021-03-13 00:01:09 +00:00
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2020-08-13 08:22:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://tekton.dev";
|
2021-02-12 19:50:36 +00:00
|
|
|
changelog = "https://github.com/tektoncd/cli/releases/tag/v${version}";
|
2022-03-09 13:53:35 +00:00
|
|
|
description = "Provides a CLI for interacting with Tekton - tkn";
|
2020-08-13 08:22:34 +00:00
|
|
|
longDescription = ''
|
2022-03-09 13:53:35 +00:00
|
|
|
The Tekton Pipelines cli project provides a CLI for interacting with
|
|
|
|
Tekton! For your convenience, it is recommended that you install the
|
|
|
|
Tekton CLI, tkn, together with the core component of Tekton, Tekton
|
|
|
|
Pipelines.
|
2020-08-13 08:22:34 +00:00
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
2021-02-12 19:50:36 +00:00
|
|
|
maintainers = with maintainers; [ jk mstrangfeld vdemeester ];
|
2022-04-01 19:34:55 +00:00
|
|
|
mainProgram = "tkn";
|
2020-08-13 08:22:34 +00:00
|
|
|
};
|
|
|
|
}
|