CLD-5699 Preliminary fixes (#25040)
* Rework some of PR24647 * Store MM_LICENSE to .env.server file * Remove legacy network setup * Fixes, generate docker-compose and env files in one place * Simplify templating mechanism for server.yml * Fix race condition for dashboard start * Fix websockets for local debugging * Fix: make webhook-interaction work again * Simplify and fix dashboard&cloud configuration, formatting fix --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b0bf5d0765
Коммит
42b3ef0238
@@ -3,38 +3,25 @@
|
||||
export
|
||||
|
||||
SHELL := /bin/bash
|
||||
TEST ?= cypress
|
||||
SERVER ?= self-hosted
|
||||
ENABLED_DOCKER_SERVICES ?= postgres inbucket
|
||||
|
||||
define log_message
|
||||
@echo "[$(shell date '+%Y-%m-%dT%H:%M:%S%Z')]$1"
|
||||
endef
|
||||
|
||||
.PHONY: all run stop
|
||||
.PHONY: all run stop clean
|
||||
all: run
|
||||
run: info generate-docker-compose create-cloud-customer start-server-test prepare-server run-test delete-cloud-customer
|
||||
stop: stop-server stop-dashboard clean-env-placeholders
|
||||
run: cloud-init generate-server start-server prepare-server run-test cloud-teardown
|
||||
stop: stop-server stop-dashboard clean
|
||||
clean:
|
||||
rm -fv .ci/server.yml
|
||||
rm -fv .ci/.env*
|
||||
|
||||
.PHONY: info generate-docker-compose start-server-test run-test start-server prepare-server stop-server restart-server
|
||||
generate-docker-compose:
|
||||
bash ./.ci/docker_compose_generator.sh
|
||||
start-server-test:
|
||||
.PHONY: generate-server start-server prepare-server run-test stop-server restart-server
|
||||
generate-server:
|
||||
bash ./.ci/server.generate.sh
|
||||
start-server: generate-server
|
||||
bash ./.ci/server.start.sh
|
||||
prepare-server:
|
||||
bash ./.ci/server.prepare.sh
|
||||
run-test:
|
||||
@if [ "$(TEST)" = "cypress" ]; then bash ./.ci/server.run_cypress.sh; \
|
||||
elif [ "$(TEST)" = "playwright" ]; then bash ./.ci/server.run_playwright.sh; \
|
||||
else $(call log_message, "TEST: $(TEST)"); fi
|
||||
info:
|
||||
$(call log_message, "TEST: $(TEST)")
|
||||
$(call log_message, "SERVER: $(SERVER)")
|
||||
$(call log_message, "ENABLED_DOCKER_SERVICES: $(ENABLED_DOCKER_SERVICES)")
|
||||
|
||||
start-server: generate-docker-compose
|
||||
TEST=server bash ./.ci/server.start.sh
|
||||
stop-server:
|
||||
bash ./.ci/server.run_test.sh
|
||||
stop-server: generate-server
|
||||
bash ./.ci/server.stop.sh
|
||||
restart-server: stop-server start-server
|
||||
|
||||
@@ -44,33 +31,19 @@ start-dashboard:
|
||||
stop-dashboard:
|
||||
bash ./.ci/dashboard.stop.sh
|
||||
|
||||
.PHONY: print-env-placeholders clean-env-placeholders
|
||||
print-env-placeholders:
|
||||
find .ci -maxdepth 1 -name '.env.*' | xargs --verbose -l cat
|
||||
clean-env-placeholders:
|
||||
git reset .ci/.env.{cypress,server,server.cloud,dashboard}
|
||||
git checkout .ci/.env.{cypress,server,server.cloud,dashboard}
|
||||
.PHONY: cloud-init cloud-teardown
|
||||
cloud-init: requirecmd-jq requirecmd-curl
|
||||
bash ./.ci/server.cloud_init.sh
|
||||
cloud-teardown:
|
||||
bash ./.ci/server.cloud_teardown.sh
|
||||
|
||||
.PHONY: create-cloud-customer delete-cloud-customer
|
||||
create-cloud-customer:
|
||||
@if [ "$(SERVER)" = "cloud" ]; then bash ./.ci/server.cloud_customer_create.sh; fi
|
||||
delete-cloud-customer:
|
||||
@if [ "$(SERVER)" = "cloud" ]; then bash ./.ci/server.cloud_customer_delete.sh; fi
|
||||
|
||||
.PHONY: prettier fmt-ci
|
||||
# Install with https://webinstall.dev/shellcheck/
|
||||
HAVE_SHELLCHECK ?= $(shell command -v shellcheck >/dev/null 2>&1 && echo yes)
|
||||
|
||||
# Install with https://webinstall.dev/shfmt/
|
||||
HAVE_SHFMT ?= $(shell command -v shfmt >/dev/null 2>&1 && echo yes)
|
||||
|
||||
prettier:
|
||||
# formats yaml files
|
||||
.PHONY: fmt-node fmt-shell fmt
|
||||
requirecmd-%:
|
||||
@which "$(*)" >/dev/null || { echo "Error, missing required CLI tool: $(*). Aborting." >&2; exit 1; }
|
||||
fmt-node: requirecmd-npx
|
||||
# Formats yaml files
|
||||
npx prettier ./.ci "!./.ci/dashboard" --write --cache
|
||||
fmt-ci: prettier
|
||||
ifeq ($(HAVE_SHFMT),yes)
|
||||
shfmt -w -s -i 2 ./.ci/*.sh
|
||||
endif
|
||||
ifeq ($(HAVE_SHELLCHECK),yes)
|
||||
shellcheck ./.ci/*.sh ./.ci/.e2erc*
|
||||
endif
|
||||
fmt-shell: requirecmd-shfmt requirecmd-shellcheck
|
||||
shfmt -w -s -i 2 ./.ci/*.sh # Install with https://webinstall.dev/shellcheck/
|
||||
shellcheck ./.ci/*.sh ./.ci/.e2erc* # Install with https://webinstall.dev/shfmt/
|
||||
fmt: fmt-node fmt-shell
|
||||
|
||||
Ссылка в новой задаче
Block a user