Build tooling enhancements (#10429)
* Add LDFLAGS variable * Replace curl by wget * Revert "Replace curl by wget" This reverts commit f40323c3d2e693f74a4a3f8705ab011feb3e378a. * Use curl instead of wget * Merge GO_LINKER_FLAGS into LDFLAGS
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
7f7f511d1c
Коммит
64562d53c0
21
Makefile
21
Makefile
@@ -48,12 +48,11 @@ GOPATH ?= $(shell go env GOPATH)
|
||||
GOFLAGS ?= $(GOFLAGS:)
|
||||
GO=go
|
||||
DELVE=dlv
|
||||
GO_LINKER_FLAGS ?= -ldflags \
|
||||
"-X github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)\
|
||||
-X 'github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)'\
|
||||
-X github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)\
|
||||
-X github.com/mattermost/mattermost-server/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)\
|
||||
-X github.com/mattermost/mattermost-server/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildNumber=$(BUILD_NUMBER)"
|
||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildDate=$(BUILD_DATE)"
|
||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHash=$(BUILD_HASH)"
|
||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildHashEnterprise=$(BUILD_HASH_ENTERPRISE)"
|
||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
||||
|
||||
# GOOS/GOARCH of the build host, used to determine whether we're cross-compiling or not
|
||||
BUILDER_GOOS_GOARCH="$(shell $(GO) env GOOS)_$(shell $(GO) env GOARCH)"
|
||||
@@ -429,7 +428,7 @@ cover: ## Runs the golang coverage tool. You must run the unit tests first.
|
||||
$(GO) tool cover -html=ecover.out
|
||||
|
||||
test-data: start-docker ## Add test data to the local instance.
|
||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) sampledata -w 1
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) sampledata -w 1
|
||||
|
||||
@echo You may need to restart the Mattermost server before using the following
|
||||
@echo ========================================================================
|
||||
@@ -441,8 +440,8 @@ run-server: start-docker ## Starts the server.
|
||||
@echo Running mattermost for development
|
||||
|
||||
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) --disableconfigwatch | \
|
||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) logs --logrus &
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) --disableconfigwatch | \
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) logs --logrus &
|
||||
|
||||
debug-server: start-docker
|
||||
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
||||
@@ -457,7 +456,7 @@ run-cli: start-docker ## Runs CLI.
|
||||
@echo Running mattermost for development
|
||||
@echo Example should be like 'make ARGS="-version" run-cli'
|
||||
|
||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) ${ARGS}
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) ${ARGS}
|
||||
|
||||
run-client: ## Runs the webapp.
|
||||
@echo Running mattermost client for development
|
||||
@@ -506,7 +505,7 @@ restart-client: | stop-client run-client ## Restarts the webapp.
|
||||
|
||||
run-job-server: ## Runs the background job server.
|
||||
@echo Running job server for development
|
||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) jobserver --disableconfigwatch &
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) jobserver --disableconfigwatch &
|
||||
|
||||
config-ldap: ## Configures LDAP.
|
||||
@echo Setting up configuration for local LDAP
|
||||
|
||||
Ссылка в новой задаче
Block a user