2017-04-25 12:57:06 -04:00
|
|
|
#
|
|
|
|
# github.com/docker/cli
|
|
|
|
#
|
|
|
|
|
2017-05-03 14:14:06 -04:00
|
|
|
.PHONY: build clean test lint cross
|
2017-04-25 12:57:06 -04:00
|
|
|
|
|
|
|
# build the CLI
|
|
|
|
build: clean
|
2017-04-27 17:55:05 -04:00
|
|
|
@go build -o ./build/docker github.com/docker/cli/cmd/docker
|
2017-04-25 12:57:06 -04:00
|
|
|
|
|
|
|
# remove build artifacts
|
|
|
|
clean:
|
2017-05-08 12:01:44 -04:00
|
|
|
@rm -rf ./build/*
|
2017-04-25 12:57:06 -04:00
|
|
|
|
2017-04-27 18:57:35 -04:00
|
|
|
# run go test
|
|
|
|
# the "-tags daemon" part is temporary
|
|
|
|
test:
|
|
|
|
@go test -tags daemon -v $(shell go list ./... | grep -v /vendor/)
|
|
|
|
|
2017-05-03 14:14:06 -04:00
|
|
|
# run linters
|
2017-05-02 15:10:03 -04:00
|
|
|
lint:
|
|
|
|
@gometalinter --config gometalinter.json ./...
|
|
|
|
|
2017-04-25 12:57:06 -04:00
|
|
|
# build the CLI for multiple architectures
|
|
|
|
cross: clean
|
|
|
|
@gox -output build/docker-{{.OS}}-{{.Arch}} \
|
|
|
|
-osarch="linux/arm linux/amd64 darwin/amd64 windows/amd64" \
|
2017-04-27 17:55:05 -04:00
|
|
|
github.com/docker/cli/cmd/docker
|
2017-05-02 16:40:29 -04:00
|
|
|
|
|
|
|
vendor: vendor.conf
|
|
|
|
@vndr 2> /dev/null
|
2017-05-08 13:49:59 -04:00
|
|
|
@if [ "`git status --porcelain -- vendor 2>/dev/null`" ]; then \
|
2017-05-02 16:40:29 -04:00
|
|
|
echo; echo "vendoring is wrong. These files were changed:"; \
|
2017-05-08 13:49:59 -04:00
|
|
|
echo; git status --porcelain -- vendor 2>/dev/null; \
|
2017-05-02 16:40:29 -04:00
|
|
|
echo; exit 1; \
|
|
|
|
fi;
|