Update README and add help target to make

Signed-off-by: Jean-Pierre Huynh <jean-pierre.huynh@ounet.fr>
This commit is contained in:
Jean-Pierre Huynh 2017-07-19 16:44:39 +01:00
parent b75596e1e4
commit 649a5864f3
2 changed files with 24 additions and 19 deletions

View File

@ -3,62 +3,61 @@
# #
all: binary all: binary
# remove build artifacts
.PHONY: clean .PHONY: clean
clean: clean: ## remove build artifacts
rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen
# run go test
# the "-tags daemon" part is temporary
.PHONY: test .PHONY: test
test: test: ## run go test
./scripts/test/unit $(shell go list ./... | grep -v '/vendor/') ./scripts/test/unit $(shell go list ./... | grep -v '/vendor/')
.PHONY: test-coverage .PHONY: test-coverage
test-coverage: test-coverage: ## run test coverage
./scripts/test/unit-with-coverage $(shell go list ./... | grep -v '/vendor/') ./scripts/test/unit-with-coverage $(shell go list ./... | grep -v '/vendor/')
.PHONY: lint .PHONY: lint
lint: lint: ## run all the lint tools
gometalinter --config gometalinter.json ./... gometalinter --config gometalinter.json ./...
.PHONY: binary .PHONY: binary
binary: binary: ## build executable for Linux
@echo "WARNING: binary creates a Linux executable. Use cross for macOS or Windows." @echo "WARNING: binary creates a Linux executable. Use cross for macOS or Windows."
./scripts/build/binary ./scripts/build/binary
.PHONY: cross .PHONY: cross
cross: cross: ## build executable for macOS and Windows
./scripts/build/cross ./scripts/build/cross
.PHONY: dynbinary .PHONY: dynbinary
dynbinary: dynbinary: ## build dynamically linked binary
./scripts/build/dynbinary ./scripts/build/dynbinary
.PHONY: watch .PHONY: watch
watch: watch: ## monitor file changes and run go test
./scripts/test/watch ./scripts/test/watch
# Check vendor matches vendor.conf vendor: vendor.conf ## check that vendor matches vendor.conf
vendor: vendor.conf
vndr 2> /dev/null vndr 2> /dev/null
scripts/validate/check-git-diff vendor scripts/validate/check-git-diff vendor
## generate man pages from go source and markdown
.PHONY: manpages .PHONY: manpages
manpages: manpages: ## generate man pages from go source and markdown
scripts/docs/generate-man.sh scripts/docs/generate-man.sh
## generate documentation YAML files consumed by docs repo
.PHONY: yamldocs .PHONY: yamldocs
yamldocs: yamldocs: ## generate documentation YAML files consumed by docs repo
scripts/docs/generate-yaml.sh scripts/docs/generate-yaml.sh
## Shellcheck validation
.PHONY: shellcheck .PHONY: shellcheck
shellcheck: shellcheck: ## run shellcheck validation
scripts/validate/shellcheck scripts/validate/shellcheck
.PHONY: help
help: ## print this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
cli/compose/schema/bindata.go: cli/compose/schema/data/*.json cli/compose/schema/bindata.go: cli/compose/schema/data/*.json
go generate github.com/docker/cli/cli/compose/schema go generate github.com/docker/cli/cli/compose/schema

View File

@ -29,6 +29,12 @@ Run all linting:
$ make -f docker.Makefile lint $ make -f docker.Makefile lint
``` ```
List all the available targets:
```
$ make help
```
### In-container development environment ### In-container development environment
Start an interactive development environment: Start an interactive development environment: