Configurable dev environment (#14869)
* Configurable dev environment * Add a bit of documentation * fixing gofmt * A bit more doc * Using variable * Adding license header * Moving LDAP_DATA variable to the default-config.mk file * Adding another docker-compose for the makefile to not brake anybody workflow * Moving dejavu to the config * Fixing docker-compose.makefile.yaml for dejavu * Adding keycloak support to the dev environment * Address PR review comments * Removing minio from default docker images * Changing the default version of mysql to the oldest supported (5.6) * Change the restart option to no for the dev environment * Fixing restart option * Reverting unneded changes * Restoring 5.7 to check if test passes * Going back to 5.6 mysql image * Fixing tests on mysql 5.6 * Skipping flaky test Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6ad5ef2b43
Коммит
e980dd7bd3
21
Makefile
21
Makefile
@@ -9,7 +9,6 @@ else
|
||||
endif
|
||||
|
||||
IS_CI ?= false
|
||||
MM_NO_DOCKER ?= false
|
||||
# Build Flags
|
||||
BUILD_NUMBER ?= $(BUILD_NUMBER:)
|
||||
BUILD_DATE = $(shell date -u)
|
||||
@@ -23,7 +22,6 @@ BUILD_ENTERPRISE ?= true
|
||||
BUILD_ENTERPRISE_READY = false
|
||||
BUILD_TYPE_NAME = team
|
||||
BUILD_HASH_ENTERPRISE = none
|
||||
LDAP_DATA ?= test
|
||||
ifneq ($(wildcard $(BUILD_ENTERPRISE_DIR)/.),)
|
||||
ifeq ($(BUILD_ENTERPRISE),true)
|
||||
BUILD_ENTERPRISE_READY = true
|
||||
@@ -97,7 +95,6 @@ PLUGIN_PACKAGES += mattermost-plugin-jira-v2.3.2
|
||||
PLUGIN_PACKAGES += mattermost-plugin-gitlab-v1.1.0
|
||||
PLUGIN_PACKAGES += mattermost-plugin-jenkins-v1.0.0
|
||||
|
||||
|
||||
# Prepares the enterprise build if exists. The IGNORE stuff is a hack to get the Makefile to execute the commands outside a target
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
IGNORE:=$(shell echo Enterprise build selected, preparing)
|
||||
@@ -122,8 +119,15 @@ MMCTL_REL_TO_DOWNLOAD = $(shell scripts/get_latest_release.sh 'mattermost/mmctl'
|
||||
|
||||
all: run ## Alias for 'run'.
|
||||
|
||||
-include config.override.mk
|
||||
include config.mk
|
||||
include build/*.mk
|
||||
|
||||
RUN_IN_BACKGROUND ?=
|
||||
ifeq ($(RUN_SERVER_IN_BACKGROUND),true)
|
||||
RUN_IN_BACKGROUND := &
|
||||
endif
|
||||
|
||||
start-docker: ## Starts the docker containers for local development.
|
||||
ifneq ($(IS_CI),false)
|
||||
@echo CI Build: skipping docker start
|
||||
@@ -132,8 +136,10 @@ else ifeq ($(MM_NO_DOCKER),true)
|
||||
else
|
||||
@echo Starting docker containers
|
||||
|
||||
docker-compose run --rm start_dependencies
|
||||
cat tests/${LDAP_DATA}-data.ldif | docker-compose exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest || true';
|
||||
$(GO) run ./build/docker-compose-generator/main.go $(ENABLED_DOCKER_SERVICES) | docker-compose -f docker-compose.makefile.yml -f /dev/stdin run --rm start_dependencies
|
||||
ifneq (,$(findstring openldap,$(ENABLED_DOCKER_SERVICES)))
|
||||
cat tests/${LDAP_DATA}-data.ldif | docker-compose -f docker-compose.makefile.yml exec -T openldap bash -c 'ldapadd -x -D "cn=admin,dc=mm,dc=test,dc=com" -w mostest || true';
|
||||
endif
|
||||
endif
|
||||
|
||||
stop-docker: ## Stops the docker containers for local development.
|
||||
@@ -368,7 +374,7 @@ run-server: prepackaged-binaries validate-go-version start-docker ## Starts the
|
||||
|
||||
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) --disableconfigwatch 2>&1 | \
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) logs --logrus &
|
||||
$(GO) run $(GOFLAGS) -ldflags '$(LDFLAGS)' $(PLATFORM_FILES) logs --logrus $(RUN_IN_BACKGROUND)
|
||||
|
||||
debug-server: start-docker ## Compile and start server using delve.
|
||||
mkdir -p $(BUILD_WEBAPP_DIR)/dist/files
|
||||
@@ -545,3 +551,6 @@ endif
|
||||
## Help documentatin à la https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
||||
help:
|
||||
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
@echo
|
||||
@echo You can modify the default settings for this Makefile creating a file config.mk based on the default-config.mk
|
||||
@echo
|
||||
|
||||
Ссылка в новой задаче
Block a user