mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-11 18:01:05 +02:00
Run ‘go generate’ from %_moq.go target in docker when BUILD_IN_DOCKER is true (#660)
This commit is contained in:
parent
1876993862
commit
34666a156d
5
Makefile
5
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...'
|
||||
|
Loading…
x
Reference in New Issue
Block a user