Use a persistent cache and pkg directory (#2235)

This commit is contained in:
Matt Robinson 2019-06-18 13:18:10 -04:00 committed by aligeti
parent 1334933cdc
commit 89cd4d7bc0

View File

@ -172,6 +172,7 @@ binary:
@if [ -z "${COMPONENT}" ]; then echo "Try one of the following targets instead:" \
&& for b in binaries ${BINARIES}; do echo "- $$b"; done && exit 1; fi
mkdir -p release/${TAG}
mkdir -p /tmp/go-cache /tmp/go-pkg
rm -f cmd/${COMPONENT}/resource.syso
if [ "${GOARCH}" = "amd64" ]; then sixtyfour="-64"; fi; \
[ "${GOARCH}" = "amd64" ] && goversioninfo $$sixtyfour -o cmd/${COMPONENT}/resource.syso \
@ -182,6 +183,7 @@ binary:
resources/versioninfo.json || echo "goversioninfo is not installed, metadata will not be created"
docker run --rm -i -v "${PWD}":/go/src/storj.io/storj -e GO111MODULE=on \
-e GOOS=${GOOS} -e GOARCH=${GOARCH} -e GOARM=6 -e CGO_ENABLED=1 \
-v /tmp/go-cache:/tmp/.cache/go-build -v /tmp/go-pkg:/go/pkg \
-w /go/src/storj.io/storj -e GOPROXY -u $(shell id -u):$(shell id -g) storjlabs/golang:${GO_VERSION} \
scripts/release.sh build -o release/${TAG}/$(COMPONENT)_${GOOS}_${GOARCH}${FILEEXT} \
storj.io/storj/cmd/${COMPONENT}