2020-04-26 04:16:52 +01:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
|
2016-10-09 18:25:39 +01:00
|
|
|
|
2019-07-03 12:00:27 +01:00
|
|
|
let
|
2016-10-09 18:25:39 +01:00
|
|
|
goPackagePath = "k8s.io/kops";
|
|
|
|
|
2019-07-03 12:00:27 +01:00
|
|
|
generic = { version, sha256, ...}@attrs:
|
|
|
|
let attrs' = builtins.removeAttrs attrs ["version" "sha256"] ; in
|
|
|
|
buildGoPackage {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "kops";
|
|
|
|
inherit version;
|
2019-07-03 12:00:27 +01:00
|
|
|
|
|
|
|
inherit goPackagePath;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = version;
|
|
|
|
owner = "kubernetes";
|
|
|
|
repo = "kops";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2020-04-26 04:16:52 +01:00
|
|
|
nativeBuildInputs = [ go-bindata installShellFiles ];
|
2020-03-18 09:23:22 +00:00
|
|
|
subPackages = [ "cmd/kops" ];
|
2019-07-03 12:00:27 +01:00
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X k8s.io/kops.Version=${version}
|
|
|
|
-X k8s.io/kops.GitVersion=${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
(cd go/src/k8s.io/kops
|
|
|
|
go-bindata -o upup/models/bindata.go -pkg models -prefix upup/models/ upup/models/...)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-26 04:16:52 +01:00
|
|
|
for shell in bash zsh; do
|
2020-04-28 02:50:57 +01:00
|
|
|
$out/bin/kops completion $shell > kops.$shell
|
2020-04-26 04:16:52 +01:00
|
|
|
installShellCompletion kops.$shell
|
|
|
|
done
|
2019-07-03 12:00:27 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Easiest way to get a production Kubernetes up and running";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kubernetes/kops";
|
2019-07-03 12:00:27 +01:00
|
|
|
license = licenses.asl20;
|
2020-03-18 09:23:22 +00:00
|
|
|
maintainers = with maintainers; [ offline zimbatm kampka ];
|
2019-07-03 12:00:27 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} // attrs';
|
|
|
|
in rec {
|
|
|
|
|
|
|
|
mkKops = generic;
|
|
|
|
|
2019-12-03 13:21:56 +00:00
|
|
|
kops_1_15 = mkKops {
|
2020-05-06 08:34:35 +01:00
|
|
|
version = "1.15.3";
|
|
|
|
sha256 = "0pzgrsl61nw8pm3s032lj020fw13x3fpzlj7lknsnd581f0gg4df";
|
2019-12-03 13:21:56 +00:00
|
|
|
};
|
2020-02-27 09:59:41 +00:00
|
|
|
|
|
|
|
kops_1_16 = mkKops {
|
2020-05-06 08:46:36 +01:00
|
|
|
version = "1.16.2";
|
|
|
|
sha256 = "1vhkjhx1n3f6ggw5cy1avs3sbqb2da6khck9zqd4s7almjbpc2h2";
|
2020-02-27 09:59:41 +00:00
|
|
|
};
|
2016-10-09 18:25:39 +01:00
|
|
|
}
|