Skip to content

Commit

Permalink
Improve Go module support in Makefile (#54)
Browse files Browse the repository at this point in the history
* Improve Go module support in Makefile

* Commit go.sum
  • Loading branch information
lblackstone authored Jun 28, 2019
1 parent c8a00a0 commit f8634fd
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Pulumi.*.yaml
/pkg/gen/openapi-specs
/pack/nodejs/bin
/pack/nodejs/node_modules
/go.sum
kubespy
releases
.idea/
.idea/
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ VERSION_FLAGS := -ldflags "-X github.com/pulumi/kubespy/version.Version=${VERS
GO ?= go
GOMETALINTERBIN ?= gometalinter
GOMETALINTER :=${GOMETALINTERBIN} --config=Gometalinter.json
GOMODULE = GO111MODULE=on
GOPROXY = 'https://proxy.golang.org'

TESTPARALLELISM := 10
TESTABLE_PKGS := ./...

ensure::
$(GOMODULE) GOPROXY=$(GOPROXY) $(GO) mod tidy

build::
$(GO) build $(VERSION_FLAGS) $(PROJECT)
$(GOMODULE) GOPROXY=$(GOPROXY) $(GO) build $(VERSION_FLAGS) $(PROJECT)

rel-darwin::
GOOS=darwin GOARCH=386 $(GO) build -o releases/kubespy-darwin-386/kubespy $(VERSION_FLAGS) $(PROJECT)
Expand All @@ -36,10 +41,10 @@ lint::
$(GOMETALINTER) ./... | sort ; exit "$${PIPESTATUS[0]}"

install::
$(GO) install $(VERSION_FLAGS) $(PROJECT)
$(GOMODULE) GOPROXY=$(GOPROXY) $(GO) install $(VERSION_FLAGS) $(PROJECT)

test_all:: test_fast
$(GO) test -v -cover -timeout 1h -parallel ${TESTPARALLELISM} $(TESTABLE_PKGS)
$(GOMODULE) GOPROXY=$(GOPROXY) $(GO) test -v -cover -timeout 1h -parallel ${TESTPARALLELISM} $(TESTABLE_PKGS)

.PHONY: check_clean_worktree
check_clean_worktree:
Expand Down
Loading

0 comments on commit f8634fd

Please sign in to comment.