use the go 1.10 build cache

Signed-off-by: Steve Kriss <steve@heptio.com>
pull/456/head
Steve Kriss 2018-04-17 12:03:10 -07:00
parent 2889db72ac
commit fd1c8294ce
3 changed files with 3 additions and 3 deletions

View File

@ -103,6 +103,7 @@ shell: build-dirs build-image
-v "$$(pwd):/go/src/$(PKG)" \
-v "$$(pwd)/_output/bin:/output" \
-v "$$(pwd)/.go/std/$(GOOS)/$(GOARCH):/usr/local/go/pkg/$(GOOS)_$(GOARCH)_static" \
-v "$$(pwd)/.go/go-build:/.cache/go-build" \
-w /go/src/$(PKG) \
$(BUILDER_IMAGE) \
/bin/sh $(CMD)
@ -171,7 +172,7 @@ tar-bin: build
build-dirs:
@mkdir -p _output/bin/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH) .go/go-build
build-image:
cd hack/build-image && docker build -t $(BUILDER_IMAGE) .

View File

@ -61,7 +61,7 @@ if [[ "${GOOS}" = "windows" ]]; then
OUTPUT="${OUTPUT}.exe"
fi
go build -i \
go build \
-o ${OUTPUT} \
-installsuffix "static" \
-ldflags "${LDFLAGS}" \

View File

@ -23,6 +23,5 @@ export CGO_ENABLED=0
TARGETS=$(for d in "$@"; do echo ./$d/...; done)
echo "Running tests:"
go test -i -installsuffix "static" ${TARGETS}
go test -installsuffix "static" -timeout 60s ${TARGETS}
echo "Success!"