-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (66 loc) · 2.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Yeoman Volto App development
### Defensive settings for make:
# https://tech.davis-hansson.com/p/make/
SHELL:=bash
.ONESHELL:
.SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c
.SILENT:
.DELETE_ON_ERROR:
MAKEFLAGS+=--warn-undefined-variables
MAKEFLAGS+=--no-builtin-rules
# Project settings
DIR=$(shell basename $$(pwd))
GIT_USER='plonegovbr'
GIT_NAME='volto-twitter-block'
GIT_BRANCH='main'
ADDON ?= "@plonegovbr/volto-twitter-block"
# Recipe snippets for reuse
# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`
# Top-level targets
addon-testing-project/package.json:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
rm -Rf addon-testing-project
npx -p @plone/scripts addon clone https://github.com/${GIT_USER}/${GIT_NAME}.git --branch ${GIT_BRANCH}
@echo "-------------------"
@echo "$(GREEN)Volto project is ready!$(RESET)"
.PHONY: project
project: addon-testing-project/package.json
@echo "$(RED)Now run: cd addon-testing-project && yarn start$(RESET)"
.PHONY: storybook
storybook: addon-testing-project/package.json
@echo "$(GREEN)Create Storybook$(RESET)"
(cd addon-testing-project && yarn build-storybook)
.PHONY: all
all: project
.PHONY: format-prettier
format-prettier: ## Format Code with Prettier
yarn run prettier:fix
.PHONY: format-stylelint
format-stylelint: ## Format Code with Stylelint
yarn run stylelint:fix
.PHONY: format
format: format-prettier format-stylelint ## Format the codebase according to our standards
.PHONY: i18n
i18n: ## Sync i18n
yarn i18n
.PHONY: i18n-ci
i18n-ci: ## Check if i18n is not synced
yarn i18n && git diff -G'^[^\"POT]' --exit-code
.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,plone.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,plone.volto,plone.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi plone.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone plone/plone-backend:6.0.0a4
.PHONY: help
help: ## Show this help.
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"