2017-04-25 19:57:06 +03:00
|
|
|
#
|
2017-05-09 19:38:23 +03:00
|
|
|
# github.com/docker/cli
|
2017-04-25 19:57:06 +03:00
|
|
|
#
|
2017-05-14 20:24:10 +03:00
|
|
|
all: binary
|
|
|
|
|
2017-07-19 18:44:39 +03:00
|
|
|
|
2017-06-23 07:52:34 +03:00
|
|
|
_:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS))
|
|
|
|
|
2017-05-10 00:29:14 +03:00
|
|
|
.PHONY: clean
|
2017-07-19 18:44:39 +03:00
|
|
|
clean: ## remove build artifacts
|
2017-05-11 04:24:32 +03:00
|
|
|
rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen
|
2017-04-25 19:57:06 +03:00
|
|
|
|
2017-08-14 22:47:06 +03:00
|
|
|
.PHONY: test-unit
|
|
|
|
test-unit: ## run unit test
|
2018-09-20 21:02:11 +03:00
|
|
|
./scripts/test/unit $(shell go list ./... | grep -vE '/vendor/|/e2e/')
|
2017-04-28 01:57:35 +03:00
|
|
|
|
2017-08-31 01:06:22 +03:00
|
|
|
.PHONY: test
|
|
|
|
test: test-unit ## run tests
|
|
|
|
|
2017-05-18 11:48:24 +03:00
|
|
|
.PHONY: test-coverage
|
2017-07-19 18:44:39 +03:00
|
|
|
test-coverage: ## run test coverage
|
2018-09-20 21:02:11 +03:00
|
|
|
./scripts/test/unit-with-coverage $(shell go list ./... | grep -vE '/vendor/|/e2e/')
|
2017-05-18 11:48:24 +03:00
|
|
|
|
2018-12-10 16:17:14 +03:00
|
|
|
.PHONY: fmt
|
|
|
|
fmt:
|
|
|
|
go list -f {{.Dir}} ./... | xargs gofmt -w -s -d
|
|
|
|
|
2017-05-10 00:29:14 +03:00
|
|
|
.PHONY: lint
|
2017-07-19 18:44:39 +03:00
|
|
|
lint: ## run all the lint tools
|
2017-05-17 19:08:50 +03:00
|
|
|
gometalinter --config gometalinter.json ./...
|
2017-05-02 22:10:03 +03:00
|
|
|
|
2017-05-12 01:52:17 +03:00
|
|
|
.PHONY: binary
|
2017-07-19 18:44:39 +03:00
|
|
|
binary: ## build executable for Linux
|
2017-05-17 19:08:50 +03:00
|
|
|
@echo "WARNING: binary creates a Linux executable. Use cross for macOS or Windows."
|
|
|
|
./scripts/build/binary
|
2017-05-12 01:52:17 +03:00
|
|
|
|
2017-05-10 00:29:14 +03:00
|
|
|
.PHONY: cross
|
2017-07-19 18:44:39 +03:00
|
|
|
cross: ## build executable for macOS and Windows
|
2017-05-17 19:08:50 +03:00
|
|
|
./scripts/build/cross
|
2017-05-02 23:40:29 +03:00
|
|
|
|
2017-09-14 01:51:30 +03:00
|
|
|
.PHONY: binary-windows
|
|
|
|
binary-windows: ## build executable for Windows
|
|
|
|
./scripts/build/windows
|
|
|
|
|
|
|
|
.PHONY: binary-osx
|
|
|
|
binary-osx: ## build executable for macOS
|
|
|
|
./scripts/build/osx
|
|
|
|
|
2017-05-12 01:52:17 +03:00
|
|
|
.PHONY: dynbinary
|
2017-07-19 18:44:39 +03:00
|
|
|
dynbinary: ## build dynamically linked binary
|
2017-05-17 19:08:50 +03:00
|
|
|
./scripts/build/dynbinary
|
2017-05-12 01:52:17 +03:00
|
|
|
|
2017-07-19 18:44:39 +03:00
|
|
|
vendor: vendor.conf ## check that vendor matches vendor.conf
|
2018-02-02 21:56:00 +03:00
|
|
|
rm -rf vendor
|
|
|
|
bash -c 'vndr |& grep -v -i clone'
|
2017-05-17 19:08:50 +03:00
|
|
|
scripts/validate/check-git-diff vendor
|
2017-05-09 22:37:22 +03:00
|
|
|
|
2018-01-02 17:47:31 +03:00
|
|
|
.PHONY: authors
|
|
|
|
authors: ## generate AUTHORS file from git history
|
|
|
|
scripts/docs/generate-authors.sh
|
|
|
|
|
2017-05-11 04:24:32 +03:00
|
|
|
.PHONY: manpages
|
2017-07-19 18:44:39 +03:00
|
|
|
manpages: ## generate man pages from go source and markdown
|
2017-06-06 07:59:50 +03:00
|
|
|
scripts/docs/generate-man.sh
|
2017-05-11 04:24:32 +03:00
|
|
|
|
|
|
|
.PHONY: yamldocs
|
2017-07-19 18:44:39 +03:00
|
|
|
yamldocs: ## generate documentation YAML files consumed by docs repo
|
2017-05-11 04:24:32 +03:00
|
|
|
scripts/docs/generate-yaml.sh
|
|
|
|
|
2017-06-29 16:10:04 +03:00
|
|
|
.PHONY: shellcheck
|
2017-07-19 18:44:39 +03:00
|
|
|
shellcheck: ## run shellcheck validation
|
2017-06-29 16:10:04 +03:00
|
|
|
scripts/validate/shellcheck
|
|
|
|
|
2017-07-19 18:44:39 +03:00
|
|
|
.PHONY: help
|
|
|
|
help: ## print this help
|
2019-01-07 19:32:56 +03:00
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
2017-07-19 18:44:39 +03:00
|
|
|
|
|
|
|
|
2017-05-09 22:37:22 +03:00
|
|
|
cli/compose/schema/bindata.go: cli/compose/schema/data/*.json
|
|
|
|
go generate github.com/docker/cli/cli/compose/schema
|
|
|
|
|
|
|
|
compose-jsonschema: cli/compose/schema/bindata.go
|
2017-05-17 19:08:50 +03:00
|
|
|
scripts/validate/check-git-diff cli/compose/schema/bindata.go
|
2017-08-15 21:32:44 +03:00
|
|
|
|
|
|
|
.PHONY: ci-validate
|
|
|
|
ci-validate:
|
|
|
|
time make -B vendor
|
|
|
|
time make -B compose-jsonschema
|
|
|
|
time make manpages
|
|
|
|
time make yamldocs
|