1 { lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv, testers, ocm }:
7 src = fetchFromGitHub {
8 owner = "openshift-online";
11 sha256 = "sha256-hcbCUzC+E7VHmqATw/1LQxdMLiFibgYiWrQHpm3jZLA=";
14 vendorHash = "sha256-NP5LLP27hn8p2gUVO/qpdu1Yp3t8iarUUKR/FjU0Qlc=";
16 # Strip the final binary.
17 ldflags = [ "-s" "-w" ];
19 nativeBuildInputs = [ installShellFiles ];
21 # Tests expect the binary to be located in the root directory.
23 ln -s $GOPATH/bin/ocm ocm
26 # Tests fail in Darwin sandbox.
27 doCheck = !stdenv.hostPlatform.isDarwin;
30 installShellCompletion --cmd ocm \
31 --bash <($out/bin/ocm completion bash) \
32 --fish <($out/bin/ocm completion fish) \
33 --zsh <($out/bin/ocm completion zsh)
36 passthru.tests.version = testers.testVersion {
38 command = "ocm version";
42 description = "CLI for the Red Hat OpenShift Cluster Manager";
44 license = licenses.asl20;
45 homepage = "https://github.com/openshift-online/ocm-cli";
46 maintainers = with maintainers; [ stehessel ];
47 platforms = platforms.all;