Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add descriptions to make help #501

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ lets us merge or address your contributions quickly.

## Developing

`doctl` has `make` targets for most tooling in the `Makefile`. Run `make`
or `make list` for a list of available targets.
`doctl` has `make` commands for most tooling in the `Makefile`. Run `make`
or `make help` for a list of available commands with descriptions.

### Go environment

Expand Down
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
# need to set go version to at least 1.11
# NOTE: Adding a target so it shows up in the help listing
# - The description is the text that is echoed in the first command in the target.
# - Only 'public' targets (start with an alphanumeric character) display in the help listing.
# - All public targets need a description

export CGO = 0

export GO111MODULE := on

list:
.PHONY: help
help:
@echo "describe make commands"
@echo ""
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null |\
awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' |\
sort |\
egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
awk -v RS= -F: \
'/^# File/,/^# Finished Make data base/ {if ($$1 ~ /^[a-zA-Z]/) {printf "%-15s%s\n", $$1, substr($$9, 9, length($$9)-9)}}' |\
sort

.PHONY: test
test:
@echo "run tests"
go test ./cmd/... ./commands/... ./do/... ./install/... ./pkg/... ./pluginhost/... .

.PHONY: clean
clean:
@echo "remove build / release artifacts"
@rm -rf builds

.PHONY: vendor
vendor:
@echo "vendor dependencies"
go mod vendor
go mod tidy

.PHONY: changelog
changelog:
@echo "generate changelog entries"
scripts/changelog.sh

.PHONY: mocks
mocks:
@echo "update mocks"
scripts/regenmocks.sh

# These builds are for convenience. This logic isn't used in the build-release process
Expand Down Expand Up @@ -58,6 +69,7 @@ _build:

.PHONY: native
native: _build
@echo "build local version"
@mv $(OUT_D)/doctl_$(GOOS)_$(GOARCH) $(OUT_D)/doctl
@echo "built $(OUT_D)/doctl"

Expand All @@ -70,6 +82,7 @@ _base_docker_cntr:

.PHONY: docker_build
docker_build: _base_docker_cntr
@echo "build doctl in local docker container"
@mkdir -p $(OUT_D)
@docker build -f Dockerfile.cntr . -t doctl_local
@docker run --rm \
Expand Down