Updates 'make help'. (#7982)
* Updates 'make help'. * Updates description of all.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
dcc2016755
Коммит
e561f727c8
88
Makefile
88
Makefile
@@ -91,11 +91,11 @@ ALL_PACKAGES_COMMA=$(TE_PACKAGES_COMMA)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: run
|
all: run ## Alias for 'run'.
|
||||||
|
|
||||||
include build/*.mk
|
include build/*.mk
|
||||||
|
|
||||||
start-docker:
|
start-docker: ## Starts the docker containers for local development.
|
||||||
@echo Starting docker containers
|
@echo Starting docker containers
|
||||||
|
|
||||||
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \
|
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \
|
||||||
@@ -174,7 +174,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
|||||||
fi
|
fi
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop-docker:
|
stop-docker: ## Stops the docker containers for local development.
|
||||||
@echo Stopping docker containers
|
@echo Stopping docker containers
|
||||||
|
|
||||||
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
|
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
|
||||||
@@ -207,7 +207,7 @@ stop-docker:
|
|||||||
docker stop mattermost-elasticsearch > /dev/null; \
|
docker stop mattermost-elasticsearch > /dev/null; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean-docker:
|
clean-docker: ## Deletes the docker containers for local development.
|
||||||
@echo Removing docker containers
|
@echo Removing docker containers
|
||||||
|
|
||||||
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
|
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
|
||||||
@@ -246,7 +246,7 @@ clean-docker:
|
|||||||
docker rm -v mattermost-elasticsearch > /dev/null; \
|
docker rm -v mattermost-elasticsearch > /dev/null; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
govet:
|
govet: ## Runs govet against all packages.
|
||||||
@echo Running GOVET
|
@echo Running GOVET
|
||||||
$(GO) vet $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
$(GO) vet $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
|||||||
$(GO) vet $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
$(GO) vet $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gofmt:
|
gofmt: ## Runs gofmt against all packages.
|
||||||
@echo Running GOFMT
|
@echo Running GOFMT
|
||||||
|
|
||||||
@for package in $(TE_PACKAGES) $(EE_PACKAGES); do \
|
@for package in $(TE_PACKAGES) $(EE_PACKAGES); do \
|
||||||
@@ -271,11 +271,11 @@ gofmt:
|
|||||||
done
|
done
|
||||||
@echo "gofmt success"; \
|
@echo "gofmt success"; \
|
||||||
|
|
||||||
store-mocks:
|
store-mocks: ## Creates mock files.
|
||||||
go get github.com/vektra/mockery/...
|
go get github.com/vektra/mockery/...
|
||||||
GOPATH=$(shell go env GOPATH) $(shell go env GOPATH)/bin/mockery -dir store -all -output store/storetest/mocks -note 'Regenerate this file using `make store-mocks`.'
|
GOPATH=$(shell go env GOPATH) $(shell go env GOPATH)/bin/mockery -dir store -all -output store/storetest/mocks -note 'Regenerate this file using `make store-mocks`.'
|
||||||
|
|
||||||
update-jira-plugin:
|
update-jira-plugin: ## Updates Jira plugin.
|
||||||
go get github.com/jteeuwen/go-bindata/...
|
go get github.com/jteeuwen/go-bindata/...
|
||||||
curl -s https://api.github.com/repos/mattermost/mattermost-plugin-jira/releases/latest | grep browser_download_url | grep darwin-amd64 | cut -d '"' -f 4 | wget -qi - -O plugin.tar.gz
|
curl -s https://api.github.com/repos/mattermost/mattermost-plugin-jira/releases/latest | grep browser_download_url | grep darwin-amd64 | cut -d '"' -f 4 | wget -qi - -O plugin.tar.gz
|
||||||
$(shell go env GOPATH)/bin/go-bindata -pkg jira -o app/plugin/jira/plugin_darwin_amd64.go plugin.tar.gz
|
$(shell go env GOPATH)/bin/go-bindata -pkg jira -o app/plugin/jira/plugin_darwin_amd64.go plugin.tar.gz
|
||||||
@@ -286,7 +286,7 @@ update-jira-plugin:
|
|||||||
rm plugin.tar.gz
|
rm plugin.tar.gz
|
||||||
gofmt -s -w ./app/plugin/jira
|
gofmt -s -w ./app/plugin/jira
|
||||||
|
|
||||||
update-zoom-plugin:
|
update-zoom-plugin: ## Updates Zoom plugin.
|
||||||
go get github.com/jteeuwen/go-bindata/...
|
go get github.com/jteeuwen/go-bindata/...
|
||||||
curl -s https://api.github.com/repos/mattermost/mattermost-plugin-zoom/releases/latest | grep browser_download_url | grep darwin-amd64 | cut -d '"' -f 4 | wget -qi - -O plugin.tar.gz
|
curl -s https://api.github.com/repos/mattermost/mattermost-plugin-zoom/releases/latest | grep browser_download_url | grep darwin-amd64 | cut -d '"' -f 4 | wget -qi - -O plugin.tar.gz
|
||||||
$(shell go env GOPATH)/bin/go-bindata -pkg zoom -o app/plugin/zoom/plugin_darwin_amd64.go plugin.tar.gz
|
$(shell go env GOPATH)/bin/go-bindata -pkg zoom -o app/plugin/zoom/plugin_darwin_amd64.go plugin.tar.gz
|
||||||
@@ -297,12 +297,12 @@ update-zoom-plugin:
|
|||||||
rm plugin.tar.gz
|
rm plugin.tar.gz
|
||||||
gofmt -s -w ./app/plugin/zoom
|
gofmt -s -w ./app/plugin/zoom
|
||||||
|
|
||||||
check-licenses:
|
check-licenses: ## Checks license status.
|
||||||
./scripts/license-check.sh $(TE_PACKAGES) $(EE_PACKAGES)
|
./scripts/license-check.sh $(TE_PACKAGES) $(EE_PACKAGES)
|
||||||
|
|
||||||
check-style: govet gofmt check-licenses
|
check-style: govet gofmt check-licenses ## Runs govet and gofmt against all packages.
|
||||||
|
|
||||||
test-te-race:
|
test-te-race: ## Checks for race conditions in the team edition.
|
||||||
@echo Testing TE race conditions
|
@echo Testing TE race conditions
|
||||||
|
|
||||||
@echo "Packages to test: "$(TE_PACKAGES)
|
@echo "Packages to test: "$(TE_PACKAGES)
|
||||||
@@ -312,7 +312,7 @@ test-te-race:
|
|||||||
$(GO) test $(GOFLAGS) -race -run=$(TESTS) -test.timeout=4000s $$package || exit 1; \
|
$(GO) test $(GOFLAGS) -race -run=$(TESTS) -test.timeout=4000s $$package || exit 1; \
|
||||||
done
|
done
|
||||||
|
|
||||||
test-ee-race:
|
test-ee-race: ## Checks for race conditions in the enterprise edition.
|
||||||
@echo Testing EE race conditions
|
@echo Testing EE race conditions
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@@ -332,19 +332,19 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
|||||||
rm -f config/*.key
|
rm -f config/*.key
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test-server-race: test-te-race test-ee-race
|
test-server-race: test-te-race test-ee-race ## Checks for race conditions.
|
||||||
|
|
||||||
do-cover-file:
|
do-cover-file: ## Creates the test coverage report file.
|
||||||
@echo "mode: count" > cover.out
|
@echo "mode: count" > cover.out
|
||||||
|
|
||||||
test-te: do-cover-file
|
test-te: do-cover-file ## Runs tests in the team edition.
|
||||||
@echo Testing TE
|
@echo Testing TE
|
||||||
@echo "Packages to test: "$(TE_PACKAGES)
|
@echo "Packages to test: "$(TE_PACKAGES)
|
||||||
find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \;
|
find . -name 'cprofile*.out' -exec sh -c 'rm "{}"' \;
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) $(TESTFLAGS) -v -timeout=2000s -covermode=count -coverpkg=$(ALL_PACKAGES_COMMA) -exec $(ROOT)/scripts/test-xprog.sh $(TE_PACKAGES)
|
$(GO) test $(GOFLAGS) -run=$(TESTS) $(TESTFLAGS) -v -timeout=2000s -covermode=count -coverpkg=$(ALL_PACKAGES_COMMA) -exec $(ROOT)/scripts/test-xprog.sh $(TE_PACKAGES)
|
||||||
find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 {} >> cover.out ; rm "{}"' \;
|
find . -name 'cprofile*.out' -exec sh -c 'tail -n +2 {} >> cover.out ; rm "{}"' \;
|
||||||
|
|
||||||
test-ee: do-cover-file
|
test-ee: do-cover-file ## Runs tests in the enterprise edition.
|
||||||
@echo Testing EE
|
@echo Testing EE
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@@ -356,55 +356,55 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
|||||||
rm -f config/*.key
|
rm -f config/*.key
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test-server: test-te test-ee
|
test-server: test-te test-ee ## Runs tests.
|
||||||
|
|
||||||
internal-test-web-client:
|
internal-test-web-client: ## Runs web client tests.
|
||||||
$(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests
|
$(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests
|
||||||
|
|
||||||
run-server-for-web-client-tests:
|
run-server-for-web-client-tests: ## Tests the server for web client.
|
||||||
$(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests_server
|
$(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests_server
|
||||||
|
|
||||||
test-client:
|
test-client: ## Test client app.
|
||||||
@echo Running client tests
|
@echo Running client tests
|
||||||
|
|
||||||
cd $(BUILD_WEBAPP_DIR) && $(MAKE) test
|
cd $(BUILD_WEBAPP_DIR) && $(MAKE) test
|
||||||
|
|
||||||
test: test-server test-client
|
test: test-server test-client ## Runs all checks and tests below (except race detection and postgres).
|
||||||
|
|
||||||
cover:
|
cover: ## Runs the golang coverage tool. You must run the unit tests first.
|
||||||
@echo Opening coverage info in browser. If this failed run make test first
|
@echo Opening coverage info in browser. If this failed run make test first
|
||||||
|
|
||||||
$(GO) tool cover -html=cover.out
|
$(GO) tool cover -html=cover.out
|
||||||
$(GO) tool cover -html=ecover.out
|
$(GO) tool cover -html=ecover.out
|
||||||
|
|
||||||
run-server: start-docker
|
run-server: start-docker ## Starts the server.
|
||||||
@echo Running mattermost for development
|
@echo Running mattermost for development
|
||||||
|
|
||||||
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
||||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) --disableconfigwatch &
|
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) --disableconfigwatch &
|
||||||
|
|
||||||
run-cli: start-docker
|
run-cli: start-docker ## Runs CLI.
|
||||||
@echo Running mattermost for development
|
@echo Running mattermost for development
|
||||||
@echo Example should be like 'make ARGS="-version" run-cli'
|
@echo Example should be like 'make ARGS="-version" run-cli'
|
||||||
|
|
||||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) ${ARGS}
|
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) ${ARGS}
|
||||||
|
|
||||||
run-client:
|
run-client: ## Runs the webapp.
|
||||||
@echo Running mattermost client for development
|
@echo Running mattermost client for development
|
||||||
|
|
||||||
ln -nfs $(BUILD_WEBAPP_DIR)/dist client
|
ln -nfs $(BUILD_WEBAPP_DIR)/dist client
|
||||||
cd $(BUILD_WEBAPP_DIR) && $(MAKE) run
|
cd $(BUILD_WEBAPP_DIR) && $(MAKE) run
|
||||||
|
|
||||||
run-client-fullmap:
|
run-client-fullmap: ## Runs the webapp with source code mapping (slower; better debugging).
|
||||||
@echo Running mattermost client for development with FULL SOURCE MAP
|
@echo Running mattermost client for development with FULL SOURCE MAP
|
||||||
|
|
||||||
cd $(BUILD_WEBAPP_DIR) && $(MAKE) run-fullmap
|
cd $(BUILD_WEBAPP_DIR) && $(MAKE) run-fullmap
|
||||||
|
|
||||||
run: run-server run-client
|
run: run-server run-client ## Runs the server and webapp.
|
||||||
|
|
||||||
run-fullmap: run-server run-client-fullmap
|
run-fullmap: run-server run-client-fullmap ## Same as run but with a full sourcemap for client.
|
||||||
|
|
||||||
stop-server:
|
stop-server: ## Stops the server.
|
||||||
@echo Stopping mattermost
|
@echo Stopping mattermost
|
||||||
|
|
||||||
ifeq ($(BUILDER_GOOS_GOARCH),"windows_amd64")
|
ifeq ($(BUILDER_GOOS_GOARCH),"windows_amd64")
|
||||||
@@ -421,24 +421,24 @@ else
|
|||||||
done
|
done
|
||||||
endif
|
endif
|
||||||
|
|
||||||
stop-client:
|
stop-client: ## Stops the webapp.
|
||||||
@echo Stopping mattermost client
|
@echo Stopping mattermost client
|
||||||
|
|
||||||
cd $(BUILD_WEBAPP_DIR) && $(MAKE) stop
|
cd $(BUILD_WEBAPP_DIR) && $(MAKE) stop
|
||||||
|
|
||||||
stop: stop-server stop-client
|
stop: stop-server stop-client ## Stops server and client.
|
||||||
|
|
||||||
restart: restart-server restart-client
|
restart: restart-server restart-client ## Restarts the server and webapp.
|
||||||
|
|
||||||
restart-server: | stop-server run-server
|
restart-server: | stop-server run-server ## Restarts the mattermost server to pick up development change.
|
||||||
|
|
||||||
restart-client: | stop-client run-client
|
restart-client: | stop-client run-client ## Restarts the webapp.
|
||||||
|
|
||||||
run-job-server:
|
run-job-server: ## Runs the background job server.
|
||||||
@echo Running job server for development
|
@echo Running job server for development
|
||||||
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) jobserver --disableconfigwatch &
|
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) $(PLATFORM_FILES) jobserver --disableconfigwatch &
|
||||||
|
|
||||||
config-ldap:
|
config-ldap: ## Configures LDAP.
|
||||||
@echo Setting up configuration for local LDAP
|
@echo Setting up configuration for local LDAP
|
||||||
|
|
||||||
@sed -i'' -e 's|"LdapServer": ".*"|"LdapServer": "dockerhost"|g' config/config.json
|
@sed -i'' -e 's|"LdapServer": ".*"|"LdapServer": "dockerhost"|g' config/config.json
|
||||||
@@ -452,12 +452,12 @@ config-ldap:
|
|||||||
@sed -i'' -e 's|"UsernameAttribute": ".*"|"UsernameAttribute": "uid"|g' config/config.json
|
@sed -i'' -e 's|"UsernameAttribute": ".*"|"UsernameAttribute": "uid"|g' config/config.json
|
||||||
@sed -i'' -e 's|"IdAttribute": ".*"|"IdAttribute": "uid"|g' config/config.json
|
@sed -i'' -e 's|"IdAttribute": ".*"|"IdAttribute": "uid"|g' config/config.json
|
||||||
|
|
||||||
config-reset:
|
config-reset: ## Resets the config/config.json file to the default.
|
||||||
@echo Resetting configuration to default
|
@echo Resetting configuration to default
|
||||||
rm -f config/config.json
|
rm -f config/config.json
|
||||||
cp config/default.json config/config.json
|
cp config/default.json config/config.json
|
||||||
|
|
||||||
clean: stop-docker
|
clean: stop-docker ## Clean up everything except persistant server data.
|
||||||
@echo Cleaning
|
@echo Cleaning
|
||||||
|
|
||||||
rm -Rf $(DIST_ROOT)
|
rm -Rf $(DIST_ROOT)
|
||||||
@@ -482,16 +482,16 @@ clean: stop-docker
|
|||||||
rm -f imports/imports.go
|
rm -f imports/imports.go
|
||||||
rm -f cmd/platform/cprofile*.out
|
rm -f cmd/platform/cprofile*.out
|
||||||
|
|
||||||
nuke: clean clean-docker
|
nuke: clean clean-docker ## Clean plus removes persistant server data.
|
||||||
@echo BOOM
|
@echo BOOM
|
||||||
|
|
||||||
rm -rf data
|
rm -rf data
|
||||||
|
|
||||||
setup-mac:
|
setup-mac: ## Adds macOS hosts entries for Docker.
|
||||||
echo $$(boot2docker ip 2> /dev/null) dockerhost | sudo tee -a /etc/hosts
|
echo $$(boot2docker ip 2> /dev/null) dockerhost | sudo tee -a /etc/hosts
|
||||||
|
|
||||||
|
|
||||||
todo:
|
todo: ## Display TODO and FIXME items in the source code.
|
||||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime TODO
|
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime TODO
|
||||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime XXX
|
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime XXX
|
||||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime FIXME
|
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime FIXME
|
||||||
@@ -502,3 +502,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
|
|||||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime FIXME enterprise/
|
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime FIXME enterprise/
|
||||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime "FIX ME" enterprise/
|
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime "FIX ME" enterprise/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
## Help documentatin à la https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||||
|
help:
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
help:
|
|
||||||
@echo "-----------------------------------------------------------------------------------------------"
|
|
||||||
@echo "------------------------------------- Makefile Help -------------------------------------------"
|
|
||||||
@echo "-----------------------------------------------------------------------------------------------"
|
|
||||||
@echo ""
|
|
||||||
@echo " General:"
|
|
||||||
@echo "make run Build and run the Mattermost server for development"
|
|
||||||
@echo "make run-fullmap Same as run but with a full sourcemap for client"
|
|
||||||
@echo "make stop Stops server and client."
|
|
||||||
@echo "make restart-server Restarts the mattermost server to pick up development change."
|
|
||||||
@echo "make clean Clean up everything except persistant server data"
|
|
||||||
@echo "make nuke clean plus removes persistant server data"
|
|
||||||
@echo ""
|
|
||||||
@echo " Testing:"
|
|
||||||
@echo "make test Runs all checks and tests below (except race detection and postgres)"
|
|
||||||
@echo "make govet Runs govet against all packages"
|
|
||||||
@echo "make gofmt Runs gofmt against all packages"
|
|
||||||
@echo "make check-style Runs govet and gofmt against all packages"
|
|
||||||
@echo "make check-server-race Runs the unit tests with race detection mode on"
|
|
||||||
@echo "make test-postgres Runs the unit tests against a postgres database"
|
|
||||||
@echo "make cover Runs the golang coverage tool. You must run the unit tests first."
|
|
||||||
@echo ""
|
|
||||||
@echo " Docker:"
|
|
||||||
@echo "make start-docker Starts the docker containers for local development"
|
|
||||||
@echo "make stop-docker Stops the docker containers for local development"
|
|
||||||
@echo "make clean-docker Deletes the docker containers for local development"
|
|
||||||
@echo ""
|
|
||||||
@echo "-----------------------------------------------------------------------------------------------"
|
|
||||||
Ссылка в новой задаче
Block a user