3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/tektoncd-cli/default.nix

60 lines
1.9 KiB
Nix
Raw Normal View History

2020-08-13 09:22:34 +01:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "tektoncd-cli";
2021-07-14 22:19:35 +01:00
version = "0.20.0";
2020-08-13 09:22:34 +01:00
src = fetchFromGitHub {
owner = "tektoncd";
repo = "cli";
rev = "v${version}";
2021-07-14 22:19:35 +01:00
sha256 = "sha256-aVR1xNmL6M/m+1znt70vrCtuABCqDz0sDp8mDFI2uIg=";
2020-08-13 09:22:34 +01:00
};
vendorSha256 = null;
2021-07-14 22:19:35 +01:00
ldflags = [ "-s" "-w" "-X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}" ];
2020-08-13 09:22:34 +01:00
nativeBuildInputs = [ installShellFiles ];
# third_party/VENDOR-LICENSE breaks build/check as go files are still included
# docs is a tool for generating docs
excludedPackages = "\\(third_party\\|cmd/docs\\)";
2020-08-13 09:22:34 +01:00
preCheck = ''
2021-04-27 17:48:42 +01:00
# Some tests try to write to the home dir
export HOME="$TMPDIR"
# Change the golden files to match our desired version
2021-07-14 22:19:35 +01:00
sed -i "s/dev/${version}/" pkg/cmd/version/testdata/{TestGetVersions-,TestGetComponentVersions/}*.golden
'';
2020-08-13 09:22:34 +01:00
postInstall = ''
installManPage docs/man/man1/*
2020-08-13 09:22:34 +01: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 09:22:34 +01:00
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/tkn --help
2021-07-14 22:19:35 +01:00
$out/bin/tkn version | grep "Client version: ${version}"
runHook postInstallCheck
'';
2020-08-13 09:22:34 +01:00
meta = with lib; {
homepage = "https://tekton.dev";
changelog = "https://github.com/tektoncd/cli/releases/tag/v${version}";
description = "Provides a CLI for interacting with Tekton";
2020-08-13 09:22:34 +01:00
longDescription = ''
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.
'';
license = licenses.asl20;
maintainers = with maintainers; [ jk mstrangfeld vdemeester ];
2020-08-13 09:22:34 +01:00
};
}