summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-08-27 13:56:31 +0200
committerGitHub <noreply@github.com>2018-08-27 13:56:31 +0200
commit3cf7fcdbfb1e727ab419e0e03333c96b62e6c0fd (patch)
treed897b8bcecaa389bcd971b0e73b6477d0c9f7438 /Makefile
parent4a02383176ee854ccd94f1075c157f76cd908e36 (diff)
downloadchat-3cf7fcdbfb1e727ab419e0e03333c96b62e6c0fd.tar.gz
chat-3cf7fcdbfb1e727ab419e0e03333c96b62e6c0fd.tar.bz2
chat-3cf7fcdbfb1e727ab419e0e03333c96b62e6c0fd.zip
Add debug-server task to make file to run mattermost using delve (#9290)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 05478cb68..94adc5fb8 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,7 @@ endif
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)'\
@@ -390,6 +391,15 @@ run-server: start-docker ## Starts the server.
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) --disableconfigwatch &
+debug-server: start-docker
+ mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
+ $(DELVE) debug $(PLATFORM_FILES) --build-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)'"
+
run-cli: start-docker ## Runs CLI.
@echo Running mattermost for development
@echo Example should be like 'make ARGS="-version" run-cli'