github.com/danielqsj/helm@v2.0.0-alpha.4.0.20160908204436-976e0ba5199b+incompatible/Makefile (about) 1 DOCKER_REGISTRY ?= gcr.io 2 IMAGE_PREFIX ?= kubernetes-helm 3 SHORT_NAME ?= tiller 4 5 # go option 6 GO ?= go 7 PKG := $(shell glide novendor) 8 TAGS := 9 TESTS := . 10 TESTFLAGS := 11 LDFLAGS := 12 GOFLAGS := 13 BINDIR := $(CURDIR)/bin 14 BINARIES := helm tiller 15 DIST_DIRS := find * -type d -exec 16 17 .PHONY: all 18 all: build 19 20 .PHONY: build 21 build: 22 GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/... 23 24 .PHONY: build-cross 25 build-cross: 26 gox -output="_dist/{{.OS}}-{{.Arch}}/{{.Dir}}" -os="darwin linux windows" -arch="amd64 386" $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/helm 27 28 # usage: make dist VERSION=v2.0.0-alpha.3 29 .PHONY: dist 30 dist: build-cross 31 ( \ 32 cd _dist && \ 33 $(DIST_DIRS) cp ../LICENSE {} \; && \ 34 $(DIST_DIRS) cp ../README.md {} \; && \ 35 $(DIST_DIRS) tar -zcf helm-${VERSION}-{}.tar.gz {} \; && \ 36 $(DIST_DIRS) zip -r helm-${VERSION}-{}.zip {} \; \ 37 ) 38 39 .PHONY: check-docker 40 check-docker: 41 @if [ -z $$(which docker) ]; then \ 42 echo "Missing \`docker\` client which is required for development"; \ 43 exit 2; \ 44 fi 45 46 .PHONY: docker-binary 47 docker-binary: BINDIR = ./rootfs 48 docker-binary: GOFLAGS += -a -installsuffix cgo 49 docker-binary: 50 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller 51 52 .PHONY: docker-build 53 docker-build: check-docker docker-binary 54 docker build --rm -t ${IMAGE} rootfs 55 docker tag ${IMAGE} ${MUTABLE_IMAGE} 56 57 .PHONY: test 58 test: build 59 test: TESTFLAGS += -race -v 60 test: test-style 61 test: test-unit 62 63 .PHONY: test-unit 64 test-unit: 65 $(GO) test $(GOFLAGS) -run $(TESTS) $(PKG) $(TESTFLAGS) 66 67 .PHONY: test-style 68 test-style: 69 @scripts/validate-go.sh 70 @scripts/validate-license.sh 71 72 .PHONY: protoc 73 protoc: 74 $(MAKE) -C _proto/ all 75 76 .PHONY: clean 77 clean: 78 @rm -rf $(BINDIR) ./rootfs/tiller ./_dist 79 80 .PHONY: coverage 81 coverage: 82 @scripts/coverage.sh 83 84 HAS_GLIDE := $(shell command -v glide;) 85 HAS_GOX := $(shell command -v gox;) 86 HAS_HG := $(shell command -v hg;) 87 HAS_GIT := $(shell command -v git;) 88 89 .PHONY: bootstrap 90 bootstrap: 91 ifndef HAS_GLIDE 92 go get -u github.com/Masterminds/glide 93 endif 94 ifndef HAS_GOX 95 go get -u github.com/mitchellh/gox 96 endif 97 ifndef HAS_HG 98 $(error You must install Mercurial (hg)) 99 endif 100 ifndef HAS_GIT 101 $(error You must install Git) 102 endif 103 glide install 104 go build -o bin/protoc-gen-go ./vendor/github.com/golang/protobuf/protoc-gen-go 105 106 include versioning.mk