mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 21:09:00 +02:00
ko: general improvements
* exclude cmd/ko so the correct entrypoint is built * add ldflags for smaller builds and version * suppress GOROOT warnings during tests * add completion * add changelog * add long description
This commit is contained in:
parent
456481aa3d
commit
6bda04bd87
|
@ -2,6 +2,7 @@
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, git
|
, git
|
||||||
|
, installShellFiles
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
|
@ -14,18 +15,37 @@ buildGoModule rec {
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-LoOXZY4uF7GSS3Dh/ozCsLJTxgmPmZZuEisJ4ShjCBc=";
|
sha256 = "sha256-LoOXZY4uF7GSS3Dh/ozCsLJTxgmPmZZuEisJ4ShjCBc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorSha256 = null;
|
vendorSha256 = null;
|
||||||
excludedPackages = "test";
|
# Don't build the legacy main.go or test dir
|
||||||
|
excludedPackages = "\\(cmd/ko\\|test\\)";
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
|
ldflags = [ "-s" "-w" "-X github.com/google/ko/pkg/commands.Version=${version}" ];
|
||||||
|
|
||||||
checkInputs = [ git ];
|
checkInputs = [ git ];
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
|
# resolves some complaints from ko
|
||||||
|
export GOROOT="$(go env GOROOT)"
|
||||||
git init
|
git init
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installShellCompletion --cmd ko \
|
||||||
|
--bash <($out/bin/ko completion) \
|
||||||
|
--zsh <($out/bin/ko completion --zsh)
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A simple, fast container image builder for Go applications.";
|
|
||||||
homepage = "https://github.com/google/ko";
|
homepage = "https://github.com/google/ko";
|
||||||
|
changelog = "https://github.com/google/ko/releases/tag/v${version}";
|
||||||
|
description = "Build and deploy Go applications on Kubernetes";
|
||||||
|
longDescription = ''
|
||||||
|
ko is a simple, fast container image builder for Go applications.
|
||||||
|
It's ideal for use cases where your image contains a single Go application without any/many dependencies on the OS base image (e.g. no cgo, no OS package dependencies).
|
||||||
|
ko builds images by effectively executing go build on your local machine, and as such doesn't require docker to be installed. This can make it a good fit for lightweight CI/CD use cases.
|
||||||
|
ko also includes support for simple YAML templating which makes it a powerful tool for Kubernetes applications.
|
||||||
|
'';
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = with maintainers; [ nickcao ];
|
maintainers = with maintainers; [ nickcao jk ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue