Skip to content

Commit 5dbb0a9

Browse files
authored
CLOUDP-234527 Remove mongocli (#2688)
1 parent 505746f commit 5dbb0a9

File tree

486 files changed

+471
-38438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

486 files changed

+471
-38438
lines changed
File renamed without changes.

CHANGELOG_MONGOCLI.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ For example please edit `./root/atlas/builder.go` to add your command builder me
158158

159159
### Adding a New Command
160160

161-
`atlascli` and `mongocli` have defined a basic structure for individual commands that should be followed.
162-
For a `mongocli scope newCommand` command, a file `internal/cli/scope/new_command.go` should implement:
161+
`atlascli` have defined a basic structure for individual commands that should be followed.
162+
For a `atlas scope newCommand` command, a file `internal/cli/scope/new_command.go` should implement:
163163

164164
- A `ScopeNewCommandOpts` struct which handles the different options for the command.
165165
- At least a `func (opts *ScopeNewCommandOpts) Run() error` function with the main command logic.

Makefile

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
GOLANGCI_VERSION=v1.56.1
44
COVERAGE=coverage.out
55

6-
MCLI_SOURCE_FILES?=./cmd/mongocli
7-
MCLI_BINARY_NAME=mongocli
8-
MCLI_VERSION?=$(shell git describe --match "mongocli/v*" | cut -d "v" -f 2)
96
MCLI_GIT_SHA?=$(shell git rev-parse HEAD)
10-
MCLI_DESTINATION=./bin/$(MCLI_BINARY_NAME)
11-
MCLI_INSTALL_PATH="${GOPATH}/bin/$(MCLI_BINARY_NAME)"
12-
MCLI_E2E_BINARY?=../../../bin/${MCLI_BINARY_NAME}
137

148
ATLAS_SOURCE_FILES?=./cmd/atlas
159
ATLAS_BINARY_NAME=atlas
@@ -18,7 +12,6 @@ ATLAS_DESTINATION=./bin/$(ATLAS_BINARY_NAME)
1812
ATLAS_INSTALL_PATH="${GOPATH}/bin/$(ATLAS_BINARY_NAME)"
1913

2014
LINKER_FLAGS=-s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit=${MCLI_GIT_SHA}
21-
MCLI_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=$(MCLI_BINARY_NAME) -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${MCLI_VERSION}
2215
ATLAS_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=atlascli -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${ATLAS_VERSION}
2316
ATLAS_E2E_BINARY?=../../../bin/${ATLAS_BINARY_NAME}
2417

@@ -36,7 +29,6 @@ export PATH := $(shell go env GOPATH)/bin:$(PATH)
3629
export PATH := ./bin:$(PATH)
3730
export TERM := linux-m
3831
export GO111MODULE := on
39-
export MCLI_E2E_BINARY
4032
export ATLAS_E2E_BINARY
4133

4234
.PHONY: pre-commit
@@ -115,49 +107,22 @@ gen-mocks: ## Generate mocks
115107
go generate ./internal...
116108

117109
.PHONY: gen-docs
118-
gen-docs: gen-docs-mongocli gen-docs-atlascli ## Generate docs for commands
119-
120-
.PHONY: gen-docs-mongocli
121-
gen-docs-mongocli: ## Generate docs for mongocli commands
122-
@echo "==> Generating docs for mongocli"
123-
go run -ldflags "$(MCLI_LINKER_FLAGS)" ./tools/mongoclidocs/main.go
124-
125-
.PHONY: gen-docs-atlascli
126-
gen-docs-atlascli: ## Generate docs for atlascli commands
127-
@echo "==> Generating docs for atlascli"
128-
go run -ldflags "$(ATLAS_LINKER_FLAGS)" ./tools/atlasclidocs/main.go
110+
gen-docs: ## Generate docs for atlascli commands
111+
@echo "==> Generating docs"
112+
go run -ldflags "$(ATLAS_LINKER_FLAGS)" ./tools/docs/main.go
129113

130114
.PHONY: build
131-
build: build-mongocli ## Generate a binary for mongocli
132-
133-
.PHONY: build-all
134-
build-all: build-mongocli build-atlascli ## Generate a binary for both CLIs
135-
136-
.PHONY: build-mongocli
137-
build-mongocli: ## Generate a mongocli binary in ./bin
138-
@echo "==> Building $(MCLI_BINARY_NAME) binary"
139-
go build -ldflags "$(MCLI_LINKER_FLAGS)" -o $(MCLI_DESTINATION) $(MCLI_SOURCE_FILES)
140-
141-
.PHONY: build-atlascli
142-
build-atlascli: ## Generate a atlascli binary in ./bin
115+
build: ## Generate an atlas binary in ./bin
143116
@echo "==> Building $(ATLAS_BINARY_NAME) binary"
144117
go build -ldflags "$(ATLAS_LINKER_FLAGS)" -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)
145118

146119
.PHONY: build-debug
147-
build-debug: build-mongocli-debug build-atlascli-debug ## Generate binaries in ./bin for debugging both CLIs
148-
149-
.PHONY: build-mongocli-debug
150-
build-mongocli-debug: ## Generate a binary in ./bin for debugging mongocli
151-
@echo "==> Building $(MCLI_BINARY_NAME) binary for debugging"
152-
go build -gcflags="$(DEBUG_FLAGS)" -ldflags "$(MCLI_LINKER_FLAGS)" -o $(MCLI_DESTINATION) $(MCLI_SOURCE_FILES)
153-
154-
.PHONY: build-atlascli-debug
155-
build-atlascli-debug: ## Generate a binary in ./bin for debugging atlascli
120+
build-debug: ## Generate a binary in ./bin for debugging atlascli
156121
@echo "==> Building $(ATLAS_BINARY_NAME) binary for debugging"
157122
go build -gcflags="$(DEBUG_FLAGS)" -ldflags "$(ATLAS_LINKER_FLAGS)" -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)
158123

159124
.PHONY: e2e-test
160-
e2e-test: build-all ## Run E2E tests
125+
e2e-test: build ## Run E2E tests
161126
@echo "==> Running E2E tests..."
162127
# the target assumes the MCLI_* environment variables are exported
163128
$(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -timeout $(E2E_TIMEOUT) -tags="$(E2E_TAGS)" ./test/e2e... $(E2E_EXTRA_ARGS)
@@ -178,16 +143,6 @@ unit-test: ## Run unit-tests
178143
$(TEST_CMD) --tags="$(UNIT_TAGS)" -race -cover -count=1 -coverprofile $(COVERAGE) ./...
179144

180145
.PHONY: install
181-
install: install-mongocli install-atlascli ## Install binaries in $GOPATH/bin for both CLIs
182-
183-
.PHONY: install-mongocli
184-
install-mongocli: ## Install mongocli binary in $GOPATH/bin
185-
@echo "==> Installing $(MCLI_BINARY_NAME) to $(MCLI_INSTALL_PATH)"
186-
go install -ldflags "$(MCLI_LINKER_FLAGS)" $(MCLI_SOURCE_FILES)
187-
@echo "==> Done..."
188-
189-
.PHONY: install-atlascli
190-
install-atlascli: ## Install atlascli binary in $GOPATH/bin
191146
@echo "==> Installing $(ATLAS_BINARY_NAME) to $(ATLAS_INSTALL_PATH)"
192147
go install -ldflags "$(ATLAS_LINKER_FLAGS)" $(ATLAS_SOURCE_FILES)
193148
@echo "==> Done..."

README.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,72 @@
11
## MongoDB Atlas CLI
22

3-
![GO tests](https://github.com/mongodb/mongodb-atlas-cli/workflows/GO%20tests/badge.svg)
4-
![golangci-lint](https://github.com/mongodb/mongodb-atlas-cli/workflows/golangci-lint/badge.svg)
3+
The MongoDB Atlas CLI is a modern command line interface that enables you to manage MongoDB Atlas from the terminal.
54

6-
The MongoDB Atlas CLI repository contains the following modern command line interfaces:
5+
![atlascli-atlas-quickstart](https://user-images.githubusercontent.com/5663078/156184669-57c8ddce-6f0a-4e84-9311-2d996cb27942.gif)
76

8-
- ![icon](https://user-images.githubusercontent.com/5663078/161288347-3d550b8c-bf06-47eb-88cb-25266383147f.png#gh-light-mode-only) ![icon](https://user-images.githubusercontent.com/5663078/161288344-33fa8e03-92ee-46ff-b490-38bf4dd8f379.png#gh-dark-mode-only)
9-
[Atlas CLI](atlascli.md)
7+
## Installing
108

11-
- ![icon](https://user-images.githubusercontent.com/5663078/161288349-dfef2cd1-0e43-4c44-b5b9-45b7d62c85f6.png#gh-light-mode-only) ![icon](https://user-images.githubusercontent.com/5663078/161288351-0afd25c9-8a06-4a4b-b732-ecf315257aae.png#gh-dark-mode-only)
12-
[MongoDB CLI](mongocli.md)
9+
### Pre-built Binaries
1310

14-
Use simple, one-line commands to interact with MongoDB Atlas, Cloud Manager, or Ops Manager, and to automate management tasks for your deployments.
11+
Download the appropriate version for your platform from [Atlas CLI releases](https://github.com/mongodb/mongodb-atlas-cli/releases).
12+
After you download the library, you can run it from anywhere and don't need to install it into a global location.
13+
This works well for shared hosts and other systems where you don't have a privileged account.
14+
15+
You can place this binary somewhere in your `PATH` for ease of use.
16+
`/usr/local/bin` is the most probable location.
17+
18+
### Build From Source
19+
20+
#### Fetch Source
21+
22+
```bash
23+
git clone https://github.com/mongodb/mongodb-atlas-cli.git
24+
cd mongodb-atlas-cli
25+
```
26+
27+
#### Build
28+
29+
To build `atlascli`, run:
30+
31+
```bash
32+
make build
33+
```
34+
35+
The resulting `atlas` binary is placed in `./bin`.
36+
37+
#### Install
38+
39+
To install the `atlas` binary in `$GOPATH/bin`, run:
40+
41+
```bash
42+
make install
43+
```
44+
45+
**Note:** running `make build` is not needed when running `make install`.
46+
47+
48+
## Usage
49+
50+
To get a list of available commands, run `atlas help`
51+
or check our documentation for more details.
52+
53+
### Configuring Atlas CLI
54+
To use `atlascli`, open your terminal, run `atlas auth login`, and follow the prompted steps.
55+
56+
### Shell Completions
57+
58+
If you install via [homebrew](#hombrew-on-macos) no additional actions are needed.
59+
60+
To get specific instructions for your preferred shell, run:
61+
62+
```bash
63+
atlas completion <bash|zsh|fish|powershell> --help
64+
```
1565

1666
## Contributing
1767

1868
See our [CONTRIBUTING.md](CONTRIBUTING.md) guide.
1969

2070
## License
2171

22-
MongoDB CLI and Atlas CLI are released under the Apache 2.0 license. See [LICENSE](LICENSE)
72+
MongoDB Atlas CLI is released under the Apache 2.0 license. See [LICENSE](LICENSE)

RELEASING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To manually generate a new stable release you can run:
4949
./scripts/release.sh atlascli/v1.0.0
5050
```
5151

52-
**Note:** Please use the `atlascli/vX.Y.Z` or `mongocli/vX.Y.Z` format for the version to release
52+
**Note:** Please use the `atlascli/vX.Y.Z` format for the version to release
5353

5454
This will do the following things:
5555
1. Tag a new version, ie: `git tag -a -s atlascli/v1.0.0 -m "atlascli/v1.0.0"`
@@ -67,12 +67,6 @@ We use `go version` to generate the SBOM for Atlas CLI binaries. You can generat
6767
go version -m <path_to_atlasCLI_binary>
6868
```
6969

70-
## MongoCLI Binary
71-
We use `go version` to generate the SBOM for MongoCLI binaries. You can generate the SBOM via the following command:
72-
```bash
73-
go version -m <path_to_mongoCLI_binary>
74-
```
75-
7670
## Atlas CLI Docker image
7771
We use `docker sbom` to generate the SBOM for the AtlasCLI docker image. You can generate the SBOM via the following command:
7872
```bash

atlascli.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

build/ci/clean-up-cloud-manager.sh

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)