Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 lib,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 testers,
8 rosa,
9 nix-update-script,
10}:
11
12buildGoModule rec {
13 pname = "rosa";
14 version = "1.2.55";
15
16 src = fetchFromGitHub {
17 owner = "openshift";
18 repo = "rosa";
19 rev = "v${version}";
20 hash = "sha256-IarqpS3KY6cL5Njkd14APfPcUqicNzODIZz6CiuCzIk=";
21 };
22 vendorHash = null;
23
24 ldflags = [
25 "-s"
26 "-w"
27 ];
28
29 __darwinAllowLocalNetworking = true;
30
31 # skip e2e tests package
32 excludedPackages = [ "tests/e2e" ];
33
34 # skip tests that require network access
35 checkFlags =
36 let
37 skippedTests = [
38 "TestCluster"
39 "TestRhRegionCommand"
40 ]
41 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestCache" ];
42 in
43 [ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ];
44
45 nativeBuildInputs = [ installShellFiles ];
46 postInstall = ''
47 installShellCompletion --cmd rosa \
48 --bash <($out/bin/rosa completion bash) \
49 --fish <($out/bin/rosa completion fish) \
50 --zsh <($out/bin/rosa completion zsh)
51 '';
52
53 passthru = {
54 tests.version = testers.testVersion {
55 package = rosa;
56 command = "rosa version --client";
57 };
58 updateScript = nix-update-script { };
59 };
60
61 meta = with lib; {
62 description = "CLI for the Red Hat OpenShift Service on AWS";
63 license = licenses.asl20;
64 homepage = "https://github.com/openshift/rosa";
65 maintainers = with maintainers; [ jfchevrette ];
66 };
67}