tektoncd-cli: cleanup

- use buildGoModule buildPhase
- let buildGoModule set platform
- add -s -w ldflags for smaller build (-5MB)
- add checkPhase running unit tests
- install man pages in 1 line
- add changelog
- add @vdemeester as a maintainer
This commit is contained in:
06kellyjac 2021-02-12 19:50:36 +00:00
parent 34e2c2b310
commit 3270eec8f0

View File

@ -13,19 +13,26 @@ buildGoModule rec {
vendorSha256 = null;
doCheck = false;
buildFlagsArray = [
"-ldflags="
"-s"
"-w"
"-X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=${version}"
];
nativeBuildInputs = [ installShellFiles ];
buildPhase = ''
make bin/tkn
# 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\\)";
preCheck = ''
# Change the golden files to match our desired version
sed -i "s/dev/${version}/" pkg/cmd/version/testdata/TestGetVersions-*.golden
'';
installPhase = ''
install bin/tkn -Dt $out/bin
mkdir -p "$out/share/man/man1"
cp docs/man/man1/* "$out/share/man/man1"
postInstall = ''
installManPage docs/man/man1/*
installShellCompletion --cmd tkn \
--bash <($out/bin/tkn completion bash) \
@ -34,14 +41,14 @@ buildGoModule rec {
'';
meta = with lib; {
description = "The Tekton Pipelines cli project provides a CLI for interacting with Tekton";
homepage = "https://tekton.dev";
changelog = "https://github.com/tektoncd/cli/releases/tag/v${version}";
description = "Provides a CLI for interacting with Tekton";
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 ];
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ jk mstrangfeld vdemeester ];
};
}