Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from jjo/jjo-use-vendor-only-deps
[jjo] use only vendor/ dependencies
- Loading branch information
Showing
2 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
kubeapps | ||
generated | ||
statik |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |