From 9bbac354d879894b6adc40af31271c190be24b0d Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 7 Oct 2021 13:07:38 +0530 Subject: [PATCH] Add new CI step for checking email templates (#18570) * Add new CI step for checking email templates https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=2c1d9628-675f-4eb6-80bb-db9e4d09b8bf ```release-note NONE ``` * Pre-install ```release-note NONE ``` * pinning down to 4.9.0 ```release-note NONE ``` Co-authored-by: Mattermod --- .circleci/config.yml | 29 ++++++++++++++++++++++++++++- templates/Makefile | 3 ++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a670bca137..1ec4b9f5f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,6 +175,20 @@ jobs: make migrations-bindata if [[ -n $(git status --porcelain) ]]; then echo "Please update the migration bindata using `make migrations-bindata`"; exit 1; fi + check-email-templates: + docker: + - image: cimg/go:1.17-node + working_directory: ~/mattermost + steps: + - attach_workspace: + at: ~/mattermost/ + - run: + command: | + cd mattermost-server + sudo npm install -g mjml@4.9.0 + make build-templates + if [[ -n $(git status --porcelain) ]]; then echo "Please update the email templates using `make build-templates`"; exit 1; fi + # Dedicate job for golangci-lint it does not need anything only the server code for that # and to make more clear when the job fails check-golangci-lint: @@ -499,6 +513,9 @@ workflows: - check-migrations: requires: - setup + - check-email-templates: + requires: + - setup - check-mattermost-vet: requires: - setup @@ -511,6 +528,7 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - check-mattermost-vet - check-golangci-lint - build-api-spec @@ -536,6 +554,7 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - test: name: test-postgres dbdriver: postgres @@ -546,13 +565,14 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - test-schema: requires: - check-app-layers - check-store-layers - check-mocks - check-migrations - + - check-email-templates release-build: jobs: - setup: @@ -593,6 +613,9 @@ workflows: - check-migrations: requires: - setup + - check-email-templates: + requires: + - setup - check-mattermost-vet: requires: - setup @@ -603,6 +626,7 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - check-mattermost-vet - check-golangci-lint - build-api-spec @@ -612,6 +636,7 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - check-mattermost-vet - build-api-spec - test: @@ -624,6 +649,7 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates - test: name: test-postgres dbdriver: postgres @@ -634,4 +660,5 @@ workflows: - check-store-layers - check-mocks - check-migrations + - check-email-templates # test-schema for master run in .gitlab-ci.yml diff --git a/templates/Makefile b/templates/Makefile index 346ae519c3..794c2a07ff 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -2,10 +2,11 @@ OUTPUT_DIR=. MJML=mjml +## Also update the circleCI file if you update this. check-prereq: ## check if mjml is installed @if ! [ -x "$$(command -v mjml)" ]; then \ echo "mjml is not installed. Installing mjml"; \ - npm install -g mjml; \ + npm install -g mjml@4.9.0; \ fi;