diff --git a/Makefile b/Makefile index 76db2231..0e3f0465 100644 --- a/Makefile +++ b/Makefile @@ -48,12 +48,12 @@ all: binary docs binary: cmd/skopeo docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage . docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/projectatomic/skopeo \ - skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG)) + skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' binary-static: cmd/skopeo docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage . docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/projectatomic/skopeo \ - skopeobuildimage make binary-local-static $(if $(DEBUG),DEBUG=$(DEBUG)) + skopeobuildimage make binary-local-static $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' # Build w/o using Docker containers binary-local: @@ -95,11 +95,11 @@ check: validate test-unit test-integration # The tests can run out of entropy and block in containers, so replace /dev/random. test-integration: build-container - $(DOCKER_RUN_DOCKER) bash -c 'rm -f /dev/random; ln -sf /dev/urandom /dev/random; SKOPEO_CONTAINER_TESTS=1 hack/make.sh test-integration' + $(DOCKER_RUN_DOCKER) bash -c 'rm -f /dev/random; ln -sf /dev/urandom /dev/random; SKOPEO_CONTAINER_TESTS=1 BUILDTAGS="$(BUILDTAGS)" hack/make.sh test-integration' test-unit: build-container # Just call (make test unit-local) here instead of worrying about environment differences, e.g. GO15VENDOREXPERIMENT. - $(DOCKER_RUN_DOCKER) make test-unit-local + $(DOCKER_RUN_DOCKER) make test-unit-local BUILDTAGS='$(BUILDTAGS)' validate: build-container $(DOCKER_RUN_DOCKER) hack/make.sh validate-git-marks validate-gofmt validate-lint validate-vet diff --git a/hack/make.sh b/hack/make.sh index f5981521..3f44b9e9 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -72,10 +72,10 @@ TESTFLAGS+=" -test.timeout=10m" go_test_dir() { dir=$1 ( - echo '+ go test' $TESTFLAGS "${SKOPEO_PKG}${dir#.}" + echo '+ go test' $TESTFLAGS ${BUILDTAGS:+-tags "$BUILDTAGS"} "${SKOPEO_PKG}${dir#.}" cd "$dir" export DEST="$ABS_DEST" # we're in a subshell, so this is safe -- our integration-cli tests need DEST, and "cd" screws it up - go test $TESTFLAGS + go test $TESTFLAGS ${BUILDTAGS:+-tags "$BUILDTAGS"} ) } diff --git a/hack/make/test-integration b/hack/make/test-integration index 564438f1..e8a599f1 100755 --- a/hack/make/test-integration +++ b/hack/make/test-integration @@ -8,7 +8,7 @@ bundle_test_integration() { # subshell so that we can export PATH without breaking other things ( - make binary-local + make binary-local ${BUILDTAGS:+BUILDTAGS="$BUILDTAGS"} make install export GO15VENDOREXPERIMENT=1 bundle_test_integration