2024-04-09 16:23:20 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, rosa, nix-update-script }:
|
2024-01-09 18:37:26 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "rosa";
|
2024-05-18 18:01:41 +00:00
|
|
|
version = "1.2.39";
|
2024-01-09 18:37:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openshift";
|
|
|
|
repo = "rosa";
|
|
|
|
rev = "v${version}";
|
2024-05-18 18:01:41 +00:00
|
|
|
hash = "sha256-K1FGiUNXSyCTmF//dculpnkTyn3hfqWrOiMUGk9kHrA=";
|
2024-01-09 18:37:26 +00:00
|
|
|
};
|
|
|
|
vendorHash = null;
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-05-04 02:49:56 +00:00
|
|
|
postPatch = ''
|
|
|
|
# e2e tests require network access
|
|
|
|
rm -r tests/e2e
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Workaround for cmd/list/rhRegion/cmd_test.go:39
|
|
|
|
# Failed to get OCM regions: Can't retrieve shards: Get "https://api.stage.openshift.com/static/ocm-shards.json": dial tcp: lookup api.stage.openshift.com on [::1]:53: read udp [::1]:55793->[::1]:53: read: connection refused
|
|
|
|
substituteInPlace "cmd/list/rhRegion/cmd_test.go" \
|
|
|
|
--replace-fail "TestRhRegionCommand" "SkipRhRegionCommand"
|
|
|
|
'';
|
|
|
|
|
2024-01-09 18:37:26 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd rosa \
|
|
|
|
--bash <($out/bin/rosa completion bash) \
|
|
|
|
--fish <($out/bin/rosa completion fish) \
|
|
|
|
--zsh <($out/bin/rosa completion zsh)
|
|
|
|
'';
|
|
|
|
|
2024-04-09 16:23:20 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = rosa;
|
|
|
|
command = "rosa version --client";
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
2024-01-09 18:37:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "CLI for the Red Hat OpenShift Service on AWS";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/openshift/rosa";
|
|
|
|
maintainers = with maintainers; [ jfchevrette ];
|
|
|
|
};
|
|
|
|
}
|