Skip to content

Commit 4524891

Browse files
authored
feat!: update cli commands (#211)
* docs: add configuration page, update intro * docs: add cli commands in tour section * docs: add intro page to tour * docs: add tabs in guides * docs: update guides with cli commands * docs: upate installation and configuration * fix: cli * docs: add cli reference, make doc, update api * cli: add version command * cli: add shell completion command * cli: add environment command * refactor: make server cmd to start and migrate * feat(cli): add asset commands * docs: update cli commands * refactor: cli config cmd, add config init * chore: add changes from suggestions * fix: start and migrate server with config flag * chore: add changes from suggestions * revert: docs * revert: docs * chore: add changes from suggestion * chore: add changes from suggestions * chore: add changes from suggestion * fix: load config, add persistant flag overloading * chore: load config from current directory first * chore: get asset with urn instead of id
1 parent 65b8328 commit 4524891

File tree

19 files changed

+798
-319
lines changed

19 files changed

+798
-319
lines changed

.goreleaser.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ builds:
1111
binary: compass
1212
flags: [-a]
1313
ldflags:
14-
- -X github.com/odpf/compass/cmd.Version={{.Tag}}
15-
- -X github.com/odpf/compass/cmd.BuildCommit={{.FullCommit}}
16-
- -X github.com/odpf/compass/cmd.BuildDate={{.Date}}
14+
- -X github.com/odpf/compass/cli.Version={{.Tag}}
15+
- -X github.com/odpf/compass/cli.BuildCommit={{.FullCommit}}
16+
- -X github.com/odpf/compass/cli.BuildDate={{.Date}}
1717
goos: [linux, darwin, windows]
1818
goarch: [amd64, 386, arm, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
1919
env:

Makefile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ PROTON_COMMIT := "c7639b42da0679b2340a52155d2fe577b9d45aa2"
66

77
all: build
88

9-
build:
10-
go build -ldflags "-X cmd.Version=${VERSION}" ${NAME}
9+
build: ## Build the compass binary
10+
go build -ldflags "-X ${NAME}/cli.Version=${VERSION}"
1111

12-
clean:
13-
rm -rf compass dist/
12+
clean: ## Clean the build artifacts
13+
rm -rf compass dist/
1414

15-
test:
15+
test: ## Run the tests
1616
go test -race ./... -coverprofile=coverage.txt
1717

18-
test-coverage: test
18+
test-coverage: test ## Print the code coverage
1919
go tool cover -html=coverage.txt -o cover.html
2020

21-
e2e-test:
21+
e2e-test: ## Run all e2e tests
2222
go test ./test/... --tags=e2e
2323

24-
generate:
24+
generate: ## Run all go generate in the code base
2525
go generate ./...
2626

2727
dist:
2828
@bash ./scripts/build.sh
2929

30-
lint:
30+
lint: ## Lint checker
3131
golangci-lint run
3232

3333
proto: ## Generate the protobuf files
@@ -36,7 +36,7 @@ proto: ## Generate the protobuf files
3636
@buf generate https://github.com/odpf/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path odpf/compass -v
3737
@echo " > protobuf compilation finished"
3838

39-
install: ## install required dependencies
39+
install: ## Install required dependencies
4040
@echo "> installing dependencies"
4141
go mod tidy
4242
go install github.com/vektra/mockery/[email protected]
@@ -46,3 +46,15 @@ install: ## install required dependencies
4646

4747
update-swagger-md:
4848
npx swagger-markdown -i proto/compass.swagger.yaml -o docs/docs/reference/api.md
49+
50+
clean-doc:
51+
@echo "> cleaning up auto-generated docs"
52+
@rm -rf ./docs/docs/reference/cli.md
53+
@rm -f ./docs/docs/reference/api.md
54+
55+
doc: clean-doc update-swagger-md ## Generate api and cli references
56+
@echo "> generate cli docs"
57+
@go run . reference --plain | sed '1 s,.*,# CLI,' > ./docs/docs/reference/cli.md
58+
59+
help: ## Display this help message
60+
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z_\-]*: *.*## *" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)