openshift: 4.1 -> 4.10
Update openshift client from 4.1 (almost three years old) to latest version. Note that the upstream repository for the `oc` CLI tool has been changed to a `openshift/oc`. I also tried to simplify the derivation by using buildGoModule and removing some unnecessary environment variables. Also added man pages, a passthru test and added myself as a maintainer.
This commit is contained in:
parent
dd697d4148
commit
d260d79ce8
|
@ -1,84 +1,68 @@
|
||||||
{ lib, fetchFromGitHub, buildGoPackage, which, go-bindata, rsync, util-linux
|
{ lib
|
||||||
, coreutils, libkrb5, ncurses, clang, installShellFiles
|
, buildGoModule
|
||||||
, components ? [
|
, fetchFromGitHub
|
||||||
"cmd/oc"
|
, libkrb5
|
||||||
"cmd/openshift"
|
, git
|
||||||
]
|
, installShellFiles
|
||||||
|
, testVersion
|
||||||
|
, openshift
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
buildGoModule rec {
|
||||||
|
pname = "openshift";
|
||||||
let
|
version = "4.10.0";
|
||||||
version = "4.1.0";
|
gitCommit = "346b183";
|
||||||
ver = lib.elemAt (lib.splitVersion version);
|
|
||||||
versionMajor = ver 0;
|
|
||||||
versionMinor = ver 1;
|
|
||||||
versionPatch = ver 2;
|
|
||||||
gitCommit = "b4261e0";
|
|
||||||
# version is in vendor/k8s.io/kubernetes/pkg/version/base.go
|
|
||||||
k8sversion = "v1.11.1";
|
|
||||||
k8sgitcommit = "b1b2997";
|
|
||||||
k8sgitMajor = "0";
|
|
||||||
k8sgitMinor = "1";
|
|
||||||
in buildGoPackage rec {
|
|
||||||
pname = "openshift-origin";
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "openshift";
|
owner = "openshift";
|
||||||
repo = "origin";
|
repo = "oc";
|
||||||
rev = "v${version}";
|
rev = "release-4.10";
|
||||||
sha256 = "16bc6ljm418kxz92gz8ldm82491mvlqamrvigyr6ff72rf7ml7ba";
|
sha256 = "Pdq3OwT5P7vvB70X+GVglT9CdJbhkm35nvEGurO1HPc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
goPackagePath = "github.com/openshift/origin";
|
vendorSha256 = null;
|
||||||
|
|
||||||
buildInputs = [ libkrb5 ];
|
buildInputs = [ libkrb5 ];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
clang
|
|
||||||
go-bindata
|
|
||||||
installShellFiles
|
|
||||||
ncurses
|
|
||||||
rsync
|
|
||||||
which
|
|
||||||
];
|
|
||||||
|
|
||||||
patchPhase = ''
|
patchPhase = ''
|
||||||
patchShebangs ./hack
|
patchShebangs ./hack
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd go/src/${goPackagePath}
|
|
||||||
# Openshift build require this variables to be set
|
# Openshift build require this variables to be set
|
||||||
# unless there is a .git folder which is not the case with fetchFromGitHub
|
# unless there is a .git folder which is not the case with fetchFromGitHub
|
||||||
echo "OS_GIT_VERSION=v${version}" >> os-version-defs
|
export SOURCE_GIT_COMMIT=${gitCommit}
|
||||||
echo "OS_GIT_TREE_STATE=clean" >> os-version-defs
|
export SOURCE_GIT_TAG=v${version}
|
||||||
echo "OS_GIT_MAJOR=${versionMajor}" >> os-version-defs
|
export SOURCE_GIT_TREE_STATE=clean
|
||||||
echo "OS_GIT_MINOR=${versionMinor}" >> os-version-defs
|
|
||||||
echo "OS_GIT_PATCH=${versionPatch}" >> os-version-defs
|
make all
|
||||||
echo "OS_GIT_COMMIT=${gitCommit}" >> os-version-defs
|
|
||||||
echo "KUBE_GIT_VERSION=${k8sversion}" >> os-version-defs
|
|
||||||
echo "KUBE_GIT_COMMIT=${k8sgitcommit}" >> os-version-defs
|
|
||||||
echo "KUBE_GIT_MAJOR=${k8sgitMajor}" >> os-version-defs
|
|
||||||
echo "KUBE_GIT_MINOR=${k8sgitMinor}" >> os-version-defs
|
|
||||||
export OS_VERSION_FILE="os-version-defs"
|
|
||||||
export CC=clang
|
|
||||||
make all WHAT='${concatStringsSep " " components}'
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$out/bin/"
|
cp oc $out/bin
|
||||||
|
|
||||||
|
mkdir -p man
|
||||||
|
./genman man oc
|
||||||
|
installManPage man/*.1
|
||||||
|
|
||||||
installShellCompletion --bash contrib/completions/bash/*
|
installShellCompletion --bash contrib/completions/bash/*
|
||||||
installShellCompletion --zsh contrib/completions/zsh/*
|
installShellCompletion --zsh contrib/completions/zsh/*
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests.version = testVersion {
|
||||||
|
package = openshift;
|
||||||
|
command = "oc version";
|
||||||
|
version = "v${version}";
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
description = "Build, deploy, and manage your applications with Docker and Kubernetes";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
homepage = "http://www.openshift.org";
|
homepage = "http://www.openshift.org";
|
||||||
maintainers = with maintainers; [offline bachp moretea];
|
maintainers = with maintainers; [ offline bachp moretea stehessel ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue