MM-52642 CLD-6352 MM-54007 Prepare setup for Playwright pipeline (#24647)
* pipeline(playwright): prepare setup for playwright * feedback address * clean up readme * Fix docker-compose command and definition for dashboard * fix the dashboard * ignore dashboard when formatting --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Mario Vitale <mvitale1989@hotmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e9da1ee8ca
Коммит
6746857ee7
@@ -1,17 +1,39 @@
|
||||
# Load environment variables from .env file
|
||||
-include .ci/.env
|
||||
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
|
||||
all: run
|
||||
run: start-server prepare-server run-cypress
|
||||
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
|
||||
|
||||
.PHONY: start-server prepare-server run-cypress stop-server restart-server
|
||||
start-server:
|
||||
.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:
|
||||
bash ./.ci/server.start.sh
|
||||
prepare-server:
|
||||
bash ./.ci/server.prepare.sh
|
||||
run-cypress:
|
||||
bash ./.ci/server.run_cypress.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.stop.sh
|
||||
restart-server: stop-server start-server
|
||||
@@ -26,5 +48,29 @@ stop-dashboard:
|
||||
print-env-placeholders:
|
||||
find .ci -maxdepth 1 -name '.env.*' | xargs --verbose -l cat
|
||||
clean-env-placeholders:
|
||||
git reset .ci/.env.{cypress,server,dashboard}
|
||||
git checkout .ci/.env.{cypress,server,dashboard}
|
||||
git reset .ci/.env.{cypress,server,server.cloud,dashboard}
|
||||
git checkout .ci/.env.{cypress,server,server.cloud,dashboard}
|
||||
|
||||
.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
|
||||
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
|
||||
|
||||
Ссылка в новой задаче
Block a user