github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/Makefile (about) 1 # 2 # github.com/docker/cli 3 # 4 all: binary 5 6 7 _:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS)) 8 9 .PHONY: clean 10 clean: ## remove build artifacts 11 rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen 12 13 .PHONY: test-unit 14 test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit 15 gotestsum $(TESTFLAGS) -- $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')} 16 17 .PHONY: test 18 test: test-unit ## run tests 19 20 .PHONY: test-coverage 21 test-coverage: ## run test coverage 22 gotestsum -- -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/') 23 24 .PHONY: fmt 25 fmt: 26 go list -f {{.Dir}} ./... | xargs gofmt -w -s -d 27 28 .PHONY: lint 29 lint: ## run all the lint tools 30 gometalinter --config gometalinter.json ./... 31 32 .PHONY: binary 33 binary: 34 ./scripts/build/binary 35 36 .PHONY: plugins 37 plugins: ## build example CLI plugins 38 ./scripts/build/plugins 39 40 .PHONY: cross 41 cross: 42 ./scripts/build/binary 43 44 .PHONY: plugins-windows 45 plugins-windows: ## build example CLI plugins for Windows 46 ./scripts/build/plugins-windows 47 48 .PHONY: plugins-osx 49 plugins-osx: ## build example CLI plugins for macOS 50 ./scripts/build/plugins-osx 51 52 .PHONY: dynbinary 53 dynbinary: ## build dynamically linked binary 54 GO_LINKMODE=dynamic ./scripts/build/binary 55 56 vendor: vendor.conf ## check that vendor matches vendor.conf 57 rm -rf vendor 58 bash -c 'vndr |& grep -v -i clone | tee ./vndr.log' 59 scripts/validate/check-git-diff vendor 60 scripts/validate/check-all-packages-vendored 61 62 .PHONY: authors 63 authors: ## generate AUTHORS file from git history 64 scripts/docs/generate-authors.sh 65 66 .PHONY: manpages 67 manpages: ## generate man pages from go source and markdown 68 scripts/docs/generate-man.sh 69 70 .PHONY: yamldocs 71 yamldocs: ## generate documentation YAML files consumed by docs repo 72 scripts/docs/generate-yaml.sh 73 74 .PHONY: shellcheck 75 shellcheck: ## run shellcheck validation 76 scripts/validate/shellcheck 77 78 .PHONY: help 79 help: ## print this help 80 @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) 81 82 83 cli/compose/schema/bindata.go: cli/compose/schema/data/*.json 84 go generate github.com/docker/cli/cli/compose/schema 85 86 compose-jsonschema: cli/compose/schema/bindata.go ## generate compose-file schemas 87 scripts/validate/check-git-diff cli/compose/schema/bindata.go 88 89 .PHONY: ci-validate 90 ci-validate: 91 time make -B vendor 92 time make -B compose-jsonschema 93 time make manpages 94 time make yamldocs