Remove more instances of GOPATH from Makefile and CI (#13450)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2020-01-21 18:19:49 +05:30
коммит произвёл mattermod
родитель f78ba00017
Коммит 5123fe0292
6 изменённых файлов: 84 добавлений и 61 удалений

Просмотреть файл

@@ -45,9 +45,9 @@ else
BUILD_CLIENT = false
endif
# Golang Flags
GOPATH ?= $(shell go env GOPATH)
# Go Flags
GOFLAGS ?= $(GOFLAGS:) -mod=vendor
GOBIN=$(PWD)/bin
GO=go
DELVE=dlv
LDFLAGS += -X "github.com/mattermost/mattermost-server/v5/model.BuildNumber=$(BUILD_NUMBER)"
@@ -168,32 +168,32 @@ endif
i18n-extract: ## Extract strings for translation from the source code
env GO111MODULE=off $(GO) get -u github.com/mattermost/mattermost-utilities/mmgotool
$(GOPATH)/bin/mmgotool i18n extract
$(GOBIN)/mmgotool i18n extract
store-mocks: ## Creates mock files.
env GO111MODULE=off $(GO) get -u github.com/vektra/mockery/...
$(GOPATH)/bin/mockery -dir store -all -output store/storetest/mocks -note 'Regenerate this file using `make store-mocks`.'
$(GOBIN)/mockery -dir store -all -output store/storetest/mocks -note 'Regenerate this file using `make store-mocks`.'
store-layers: ## Generate layers for the store
$(GO) generate $(GOFLAGS) ./store
filesstore-mocks: ## Creates mock files.
env GO111MODULE=off $(GO) get -u github.com/vektra/mockery/...
$(GOPATH)/bin/mockery -dir services/filesstore -all -output services/filesstore/mocks -note 'Regenerate this file using `make filesstore-mocks`.'
$(GOBIN)/mockery -dir services/filesstore -all -output services/filesstore/mocks -note 'Regenerate this file using `make filesstore-mocks`.'
ldap-mocks: ## Creates mock files for ldap.
env GO111MODULE=off $(GO) get -u github.com/vektra/mockery/...
$(GOPATH)/bin/mockery -dir enterprise/ldap -all -output enterprise/ldap/mocks -note 'Regenerate this file using `make ldap-mocks`.'
$(GOBIN)/mockery -dir enterprise/ldap -all -output enterprise/ldap/mocks -note 'Regenerate this file using `make ldap-mocks`.'
plugin-mocks: ## Creates mock files for plugins.
env GO111MODULE=off $(GO) get -u github.com/vektra/mockery/...
$(GOPATH)/bin/mockery -dir plugin -name API -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
$(GOPATH)/bin/mockery -dir plugin -name Hooks -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
$(GOPATH)/bin/mockery -dir plugin -name Helpers -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
$(GOBIN)/mockery -dir plugin -name API -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
$(GOBIN)/mockery -dir plugin -name Hooks -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
$(GOBIN)/mockery -dir plugin -name Helpers -output plugin/plugintest -outpkg plugintest -case underscore -note 'Regenerate this file using `make plugin-mocks`.'
einterfaces-mocks: ## Creates mock files for einterfaces.
env GO111MODULE=off $(GO) get -u github.com/vektra/mockery/...
$(GOPATH)/bin/mockery -dir einterfaces -all -output einterfaces/mocks -note 'Regenerate this file using `make einterfaces-mocks`.'
$(GOBIN)/mockery -dir einterfaces -all -output einterfaces/mocks -note 'Regenerate this file using `make einterfaces-mocks`.'
pluginapi: ## Generates api and hooks glue code for plugins
$(GO) generate $(GOFLAGS) ./plugin
@@ -259,7 +259,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
else
@echo Running only TE tests
endif
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(ALL_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)"
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(ALL_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)"
internal-test-web-client: ## Runs web client tests.
$(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests
@@ -451,15 +451,15 @@ update-dependencies: ## Uses go get -u to update all the dependencies while hold
$(GO) mod vendor
vet: ## Run mattermost go vet specific checks
@if ! [ -x "$$(command -v mattermost-govet)" ]; then \
echo "mattermost-govet is not installed. Please install it executing \"GO111MODULE=off go get -u github.com/mattermost/mattermost-govet\""; \
@if ! [ -x "$$(command -v $(GOBIN)/mattermost-govet)" ]; then \
echo "mattermost-govet is not installed. Please install it executing \"GO111MODULE=off GOBIN=$(PWD)/bin go get -u github.com/mattermost/mattermost-govet\""; \
exit 1; \
fi; \
$(GO) vet -vettool=$(GOPATH)/bin/mattermost-govet -license -structuredLogging -inconsistentReceiverName ./...
$(GO) vet -vettool=$(GOBIN)/mattermost-govet -license -structuredLogging -inconsistentReceiverName ./...
ifeq ($(BUILD_ENTERPRISE_READY),true)
ifneq ($(MM_NO_ENTERPRISE_LINT),true)
$(GO) vet -vettool=$(GOPATH)/bin/mattermost-govet -enterpriseLicense -structuredLogging ./enterprise/...
$(GO) vet -vettool=$(GOBIN)/mattermost-govet -enterpriseLicense -structuredLogging ./enterprise/...
endif
endif