Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jjo] use only vendor/ dependencies #25

Merged
merged 1 commit into from Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
kubeapps
generated
statik
28 changes: 19 additions & 9 deletions Makefile
@@ -1,35 +1,45 @@
GO = go
IMPORT_PATH:= github.com/kubeapps/installer
GOBIN = go
# Force builds to only use vendor/'ed dependencies
# i.e. ignore local $GOPATH/src installed sources
GOPATH_TMP = $(CURDIR)/.GOPATH
GO = /usr/bin/env GOPATH=$(GOPATH_TMP) $(GOBIN)
GO_FLAGS =
GOFMT = gofmt
VERSION = dev-$(shell date +%FT%T%z)

OS = linux
ARCH = amd64
BINARY = kubeapps
GO_PACKAGES = ./cmd/...
GO_FILES := $(shell find $(shell $(GO) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_PACKAGES = $(IMPORT_PATH)/cmd
GO_FILES := $(shell find $(shell $(GOBIN) list -f '{{.Dir}}' $(GO_PACKAGES)) -name \*.go)
GO_FLAGS = -ldflags="-w -X github.com/kubeapps/installer/cmd.VERSION=${VERSION}"
EMBEDDED_STATIC = generated/statik/statik.go

default: binary

binary: $(EMBEDDED_STATIC)
$(GO) build -o $(BINARY) $(GO_FLAGS) .
binary: build-prep $(EMBEDDED_STATIC)
$(GO) build -i -o $(BINARY) $(GO_FLAGS) $(IMPORT_PATH)

test: $(EMBEDDED_STATIC)
test: build-prep $(EMBEDDED_STATIC)
$(GO) test $(GO_FLAGS) $(GO_PACKAGES)

$(EMBEDDED_STATIC): $(wilcard static/*)
$(EMBEDDED_STATIC): build-prep $(wilcard static/*)
$(GO) build -o statik ./vendor/github.com/rakyll/statik/statik.go
$(GO) generate

build-prep:
mkdir -p $(dir $(GOPATH_TMP)/src/$(IMPORT_PATH))
ln -snf $(CURDIR) $(GOPATH_TMP)/src/$(IMPORT_PATH)

fmt:
$(GOFMT) -s -w $(GO_FILES)

vet:
$(GO) vet $(GO_FLAGS) $(GO_PACKAGES)

clean:
$(RM) kubeapps $(EMBEDDED_STATIC)
$(RM) ./kubeapps ./statik $(EMBEDDED_STATIC)
$(RM) -r $(GOPATH_TMP)

.PHONY: default binary test fmt vet clean
.PHONY: default binary test fmt vet clean build-prep