Skip to content

Commit

Permalink
use bind mount for pristine builds
Browse files Browse the repository at this point in the history
Switch from using a build-time vendor as that broke normal `make build`
calls.
  • Loading branch information
eikenb committed Aug 9, 2019
1 parent dcb81f9 commit ece8cee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ define make-xc-target
GOOS="${1}" \
GOARCH="${2}" \
go build \
-mod vendor \
-a \
-o="pkg/${1}_${2}/${NAME}${3}" \
-ldflags "${LD_FLAGS}" \
Expand All @@ -75,13 +74,13 @@ $(foreach goarch,$(XC_ARCH),$(foreach goos,$(XC_OS),$(eval $(call make-xc-target

# Use docker to create pristine builds for release
pristine:
@go mod vendor
@docker run \
--interactive \
--user $$(id -u):$$(id -g) \
--rm \
--dns="8.8.8.8" \
--volume="${CURRENT_DIR}:/go/src/${PROJECT}" \
--volume="${GOPATH}/pkg/mod:/go/pkg/mod" \
--workdir="/go/src/${PROJECT}" \
--env=CGO_ENABLED="0" \
--env=GO111MODULE=on \
Expand Down Expand Up @@ -138,6 +137,7 @@ define make-docker-target
--tag="${OWNER}/${NAME}:${1}" \
--tag="${OWNER}/${NAME}:${VERSION}-${1}" \
"${CURRENT_DIR}"
@rm -rf "${CURRENT_DIR}/vendor/"
.PHONY: docker-build/$1

docker-build:: docker-build/$1
Expand Down Expand Up @@ -171,7 +171,6 @@ test-race:
_cleanup:
@rm -rf "${CURRENT_DIR}/pkg/"
@rm -rf "${CURRENT_DIR}/bin/"
@rm -rf "${CURRENT_DIR}/vendor/"
.PHONY: _cleanup

clean: _cleanup
Expand Down

0 comments on commit ece8cee

Please sign in to comment.