Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
testers,
|
|
installShellFiles,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "harbor-cli";
|
|
version = "0.0.12";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "goharbor";
|
|
repo = "harbor-cli";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-wdUXLgmdxkWzvLCuIJSkos1z7nyETZv3mNzGtBBJVUM=";
|
|
};
|
|
|
|
vendorHash = "sha256-OJTyX+HXyC6avsgUCzEfU0ej493J8p77r59j+X/Vqwk=";
|
|
|
|
excludedPackages = [
|
|
"dagger"
|
|
"doc"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/goharbor/harbor-cli/cmd/harbor/internal/version.Version=${finalAttrs.version}"
|
|
];
|
|
|
|
doCheck = false; # Network required
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
export HOME="$(mktemp -d)"
|
|
|
|
installShellCompletion --cmd harbor \
|
|
--bash <($out/bin/harbor completion bash) \
|
|
--fish <($out/bin/harbor completion fish) \
|
|
--zsh <($out/bin/harbor completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = finalAttrs.finalPackage;
|
|
command = "HOME=\"$(mktemp -d)\" harbor version";
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://github.com/goharbor/harbor-cli";
|
|
description = "Command-line tool facilitates seamless interaction with the Harbor container registry";
|
|
changelog = "https://github.com/goharbor/harbor-cli/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ aaronjheng ];
|
|
mainProgram = "harbor";
|
|
};
|
|
})
|