From 34666a156d79a5ad1e50bd971e31a61cf63dac5f Mon Sep 17 00:00:00 2001 From: Lucas Mundim Date: Wed, 6 Feb 2019 02:03:02 -0200 Subject: [PATCH] =?UTF-8?q?Run=20=E2=80=98go=20generate=E2=80=99=20from=20?= =?UTF-8?q?%=5Fmoq.go=20target=20in=20docker=20when=20BUILD=5FIN=5FDOCKER?= =?UTF-8?q?=20is=20true=20(#660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 9fa63a59..4047265f 100644 --- a/Makefile +++ b/Makefile @@ -151,8 +151,13 @@ gomoqs: ./pkg/controllers/proxy/network_services_controller_moq.go # file_moq.go file is generated from file.go "//go:generate moq ..." in-file # annotation, as it needs to know which interfaces to create mock stubs for %_moq.go: %.go +ifeq "$(BUILD_IN_DOCKER)" "true" + $(DOCKER) run -v $(PWD):/go/src/github.com/cloudnativelabs/kube-router -w /go/src/github.com/cloudnativelabs/kube-router $(DOCKER_BUILD_IMAGE) \ + sh -c 'apk add --no-cache git build-base && go get github.com/matryer/moq && go generate -v $(*).go' +else @test -x $(GOPATH)/bin/moq && exit 0; echo "ERROR: 'moq' tool is needed to update mock test files, install it with: \ngo get github.com/matryer/moq\n"; exit 1 go generate -v $(*).go +endif gopath: ## Warns about issues building from a directory that does not match upstream. @echo 'Checking project path for import issues...'