mongodb-atlas-cli: init at 1.42.0 (#398530)
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
testers,
|
||||
mongodb-atlas-cli,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "mongodb-atlas-cli";
|
||||
version = "1.42.0";
|
||||
|
||||
vendorHash = "sha256-5kCaQ4bBRiGjRh65Tx3g5SlwAb+/S8o+z/2x8IqSXDM=";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mongodb";
|
||||
repo = "mongodb-atlas-cli";
|
||||
rev = "refs/tags/atlascli/v${version}";
|
||||
sha256 = "sha256-7umwluhPNhY/AGmVhxITLeoAGJPglRP+1PuXOM6TmBA=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.GitCommit=${src.rev}"
|
||||
"-X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.Version=v${version}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd atlas \
|
||||
--bash <($out/bin/atlas completion bash) \
|
||||
--fish <($out/bin/atlas completion fish) \
|
||||
--zsh <($out/bin/atlas completion zsh)
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script {
|
||||
extraArgs = [ "--version-regex=atlascli/v(.+)" ];
|
||||
};
|
||||
tests.version = testers.testVersion {
|
||||
package = mongodb-atlas-cli;
|
||||
version = "v${version}";
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.mongodb.com/try/download/shell";
|
||||
description = "CLI utility to manage MongoDB Atlas from the terminal";
|
||||
maintainers = with lib.maintainers; [ aduh95 ];
|
||||
license = lib.licenses.asl20;
|
||||
mainProgram = "atlas";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user