Improve Makefile style
Этот коммит содержится в:
35
Makefile
35
Makefile
@@ -93,6 +93,22 @@ else
|
|||||||
BUILD_BOARDS = false
|
BUILD_BOARDS = false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Playbooks
|
||||||
|
BUILD_PLAYBOOKS_DIR ?= ../mattermost-plugin-playbooks
|
||||||
|
BUILD_PLAYBOOKS ?= false
|
||||||
|
BUILD_HASH_PLAYBOOKS = none
|
||||||
|
|
||||||
|
ifneq ($(wildcard $(BUILD_PLAYBOOKS_DIR)/.),)
|
||||||
|
ifeq ($(BUILD_PLAYBOOKS),true)
|
||||||
|
BUILD_PLAYBOOKS = true
|
||||||
|
BUILD_HASH_PLAYBOOKS = $(shell cd $(BUILD_PLAYBOOKS_DIR) && git rev-parse HEAD)
|
||||||
|
else
|
||||||
|
BUILD_PLAYBOOKS = false
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
BUILD_PLAYBOOKS = false
|
||||||
|
endif
|
||||||
|
|
||||||
# We need current user's UID for `run-haserver` so docker compose does not run server
|
# We need current user's UID for `run-haserver` so docker compose does not run server
|
||||||
# as root and mess up file permissions for devs. When running like this HOME will be blank
|
# as root and mess up file permissions for devs. When running like this HOME will be blank
|
||||||
# and docker will add '/', so we need to set the go-build cache location or we'll get
|
# and docker will add '/', so we need to set the go-build cache location or we'll get
|
||||||
@@ -116,6 +132,7 @@ LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashEnterpr
|
|||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=$(BUILD_ENTERPRISE_READY)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashBoards=$(BUILD_HASH_BOARDS)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashBoards=$(BUILD_HASH_BOARDS)"
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildBoards=$(BUILD_BOARDS)"
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildBoards=$(BUILD_BOARDS)"
|
||||||
|
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashPlaybooks=$(BUILD_HASH_PLAYBOOKS)"
|
||||||
|
|
||||||
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
|
||||||
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
||||||
@@ -198,30 +215,12 @@ else
|
|||||||
IGNORE:=$(shell rm -f imports/boards_imports.go)
|
IGNORE:=$(shell rm -f imports/boards_imports.go)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Playbooks
|
|
||||||
BUILD_PLAYBOOKS_DIR ?= ../mattermost-plugin-playbooks
|
|
||||||
BUILD_PLAYBOOKS ?= false
|
|
||||||
BUILD_HASH_PLAYBOOKS = none
|
|
||||||
|
|
||||||
ifneq ($(wildcard $(BUILD_PLAYBOOKS_DIR)/.),)
|
|
||||||
ifeq ($(BUILD_PLAYBOOKS),true)
|
|
||||||
BUILD_PLAYBOOKS = true
|
|
||||||
BUILD_HASH_PLAYBOOKS = $(shell cd $(BUILD_PLAYBOOKS_DIR) && git rev-parse HEAD)
|
|
||||||
else
|
|
||||||
BUILD_PLAYBOOKS = false
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
BUILD_PLAYBOOKS = false
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_PLAYBOOKS),true)
|
ifeq ($(BUILD_PLAYBOOKS),true)
|
||||||
IGNORE:=$(shell cp $(BUILD_PLAYBOOKS_DIR)/product/imports/playbooks_imports.go imports/)
|
IGNORE:=$(shell cp $(BUILD_PLAYBOOKS_DIR)/product/imports/playbooks_imports.go imports/)
|
||||||
else
|
else
|
||||||
IGNORE:=$(shell rm -f imports/playbooks_imports.go)
|
IGNORE:=$(shell rm -f imports/playbooks_imports.go)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS += -X "github.com/mattermost/mattermost-server/v6/model.BuildHashPlaybooks=$(BUILD_HASH_PLAYBOOKS)"
|
|
||||||
|
|
||||||
all: run ## Alias for 'run'.
|
all: run ## Alias for 'run'.
|
||||||
|
|
||||||
-include config.override.mk
|
-include config.override.mk
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user