mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.7 KiB
82 lines
1.7 KiB
DOCKER_REGISTRY ?= gcr.io
|
|
IMAGE_PREFIX ?= kubernetes-helm
|
|
SHORT_NAME ?= tiller
|
|
|
|
# go option
|
|
GO ?= go
|
|
PKG := $(shell glide novendor)
|
|
TAGS :=
|
|
TESTS := .
|
|
TESTFLAGS :=
|
|
LDFLAGS :=
|
|
GOFLAGS :=
|
|
BINDIR := $(CURDIR)/bin
|
|
BINARIES := helm tiller
|
|
|
|
.PHONY: all
|
|
all: build
|
|
|
|
.PHONY: build
|
|
build:
|
|
GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' github.com/kubernetes/helm/cmd/...
|
|
|
|
.PHONY: check-docker
|
|
check-docker:
|
|
@if [ -z $$(which docker) ]; then \
|
|
echo "Missing \`docker\` client which is required for development"; \
|
|
exit 2; \
|
|
fi
|
|
|
|
.PHONY: docker-binary
|
|
docker-binary: BINDIR = ./rootfs
|
|
docker-binary: GOFLAGS += -a -installsuffix cgo
|
|
docker-binary:
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' github.com/kubernetes/helm/cmd/tiller
|
|
|
|
.PHONY: docker-build
|
|
docker-build: check-docker docker-binary
|
|
docker build --rm -t ${IMAGE} rootfs
|
|
docker tag -f ${IMAGE} ${MUTABLE_IMAGE}
|
|
|
|
.PHONY: test
|
|
test: build
|
|
test: TESTFLAGS += -race -v
|
|
test: test-style
|
|
test: test-unit
|
|
|
|
.PHONY: test-unit
|
|
test-unit:
|
|
$(GO) test $(GOFLAGS) -run $(TESTS) $(PKG) $(TESTFLAGS)
|
|
|
|
.PHONY: test-style
|
|
test-style:
|
|
@scripts/validate-go.sh
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
@rm -rf $(BINDIR)
|
|
@rm ./rootfs/tiller
|
|
|
|
.PHONY: coverage
|
|
coverage:
|
|
@scripts/coverage.sh
|
|
|
|
HAS_GLIDE := $(shell command -v glide;)
|
|
HAS_HG := $(shell command -v hg;)
|
|
HAS_GIT := $(shell command -v git;)
|
|
|
|
.PHONY: bootstrap
|
|
bootstrap:
|
|
ifndef HAS_GLIDE
|
|
go get -u github.com/Masterminds/glide
|
|
endif
|
|
ifndef HAS_HG
|
|
$(error You must install Mercurial (hg))
|
|
endif
|
|
ifndef HAS_GIT
|
|
$(error You must install Git)
|
|
endif
|
|
glide install
|
|
|
|
include versioning.mk
|