Skip to content

Commit

Permalink
Push exporting of GOFLAGS variable before we run any go commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Rodrigues authored and trierra committed Feb 10, 2020
1 parent 8162c25 commit dfc0d6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ WORKDIR /go/src/github.com/portworx/torpedo
RUN apk update && \
apk add git gcc musl-dev && \
apk add make && \
apk add openssh-client && \
go get github.com/onsi/ginkgo/ginkgo && \
go get github.com/onsi/gomega && \
go get github.com/sirupsen/logrus
apk add openssh-client

# No need to copy *everything*. This keeps the cache useful
COPY deployments deployments
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
TORPEDO_IMG=$(DOCKER_HUB_REPO)/$(DOCKER_HUB_TORPEDO_IMAGE):$(DOCKER_HUB_TAG)
.PHONY: vendor

export GO111MODULE=on
export GOFLAGS = -mod=vendor
HAS_GOMODULES := $(shell go help mod why 2> /dev/null)

ifndef HAS_GOMODULES
$(error torpedo can only be built with go 1.11+ which supports go modules)
endif

ifndef TAGS
TAGS := daemon
endif

ifndef PKGS
PKGS := $(shell go list ./... 2>&1 | grep -v 'github.com/portworx/torpedo/vendor' | grep -v 'github.com/portworx/torpedo/tests')
PKGS := $(shell GOFLAGS=-mod=vendor go list ./... 2>&1 | grep -v 'github.com/portworx/torpedo/tests')
endif

ifeq ($(BUILD_TYPE),debug)
Expand All @@ -26,14 +34,6 @@ SYSBENCH_IMG=$(DOCKER_HUB_REPO)/torpedo-sysbench:latest
PGBENCH_IMG=$(DOCKER_HUB_REPO)/torpedo-pgbench:latest
ESLOAD_IMG=$(DOCKER_HUB_REPO)/torpedo-esload:latest

HAS_GOMODULES := $(shell go help mod why 2> /dev/null)

ifdef HAS_GOMODULES
export GO111MODULE=on
export GOFLAGS = -mod=vendor
else
$(error torpedo can only be built with go 1.11+ which supports go modules)
endif

all: vet lint build fmt

Expand Down

0 comments on commit dfc0d6f

Please sign in to comment.