This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
151 lines (137 loc) · 6.09 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
SHELL=/bin/bash
DIR=$(shell basename $$(pwd))
ADDON ?= volto-slate:asDefault,asDefaultRichText
# 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`
build-frontend:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
ln -sf $$(pwd) project/src/addons/
cp .project.eslintrc.js .eslintrc.js
cd project && yarn
@echo "-------------------"
@echo "Project is ready!"
@echo "Now run: cd project && yarn start"
.PHONY: build-backend
build-backend: ## Build Plone 5.2
(cd api && python3 -m venv .)
(cd api && bin/pip install --upgrade pip)
(cd api && bin/pip install --upgrade wheel)
(cd api && bin/pip install -r requirements.txt)
(cd api && bin/buildout)
.PHONY: build
build:
make build-backend
make build-frontend
all: build
.PHONY: start-backend
start-backend: ## Start Plone Backend
@echo "$(GREEN)==> Start Plone Backend$(RESET)"
(cd api && PYTHONWARNINGS=ignore bin/instance fg)
.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
ZSERVER_PORT=55001 CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors,eea.volto.slate APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage,eea.volto.slate:default ./api/bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
.PHONY: start-docker-backend
start-docker-backend:
@echo "$(GREEN)==> Start Plone Backend$(RESET)"
docker pull plone
docker run -it --rm -e SITE="Plone" -e ADDONS="eea.schema.slate" -e VERSIONS="plone.schema=1.3.0 plone.restapi=8.9.1" -e PROFILES="profile-plone.restapi:blocks" -p 8080:8080 plone fg
.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 :)"
.PHONY: test
test:
docker pull plone/volto-addon-ci
docker run -it --rm -e GIT_NAME=volto-slate -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/volto-slate" plone/volto-addon-ci yarn test --watchAll=false
.PHONY: test-update
test-update:
docker pull plone/volto-addon-ci
docker run -it --rm -e GIT_NAME=volto-slate -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/volto-slate" plone/volto-addon-ci yarn test --watchAll=false -u
.PHONY: test-acceptance-server
test-acceptance-server: ## Run test acceptance server
docker run -i --rm --name=plone -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,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
#
# build-frontend:
# yarn && RAZZLE_API_PATH=http://localhost:55001/plone yarn build
#
# .PHONY: Build Plone 5.2
# build-backend: ## Build Plone 5.2
# (cd api && python3 -m venv .)
# (cd api && bin/pip install --upgrade pip)
# (cd api && bin/pip install --upgrade wheel)
# (cd api && bin/pip install -r requirements.txt)
# (cd api && bin/buildout)
#
# .PHONY: Build Plone 5.2 in specific port
# build-backend-withport: ## Build Plone 5.2 with port
# (cd api && python3 -m venv .)
# (cd api && bin/pip install --upgrade pip)
# (cd api && bin/pip install --upgrade wheel)
# (cd api && bin/pip install -r requirements.txt)
# (cd api && bin/buildout instance:http-address=$(INSTANCE_PORT))
#
# dist:
# yarn
# yarn build
#
# test:
# (cd api && bin/test)
#
# docs-serve:
# (cd docs && ../bin/mkdocs serve)
#
# docs-build:
# # The build in netlify breaks because they have not installed ensurepip
# # So we should continue using virtualenv
# virtualenv --python=python3 .
# ./bin/pip install -r requirements-docs.txt
# (cd docs && ../bin/mkdocs build)
#
# start-frontend: dist
# yarn start:prod
#
# start-backend-docker:
# docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone
#
# start-backend-docker-guillotina:
# docker-compose -f g-api/docker-compose.yml up -d
#
# stop-backend-docker-guillotina:
# docker-compose -f g-api/docker-compose.yml down
#
# test-acceptance-server:
# 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,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
#
# test-acceptance-server-old:
# ZSERVER_PORT=55001 CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage ./api/bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
#
# test-acceptance-guillotina:
# docker-compose -f g-api/docker-compose.yml up > /dev/null
#
# clean:
# (cd api && rm -rf bin eggs develop-eggs include lib parts .installed.cfg .mr.developer.cfg)
# rm -rf node_modules
#
# .PHONY: start-test-frontend
# start-test-frontend: ## Start Test Volto Frontend
# @echo "$(GREEN)==> Start Test Volto Frontend$(RESET)"
# RAZZLE_API_PATH=http://localhost:55001/plone yarn build && NODE_ENV=production node build/server.js
#
# .PHONY: start-test
# start-test: ## Start Test
# @echo "$(GREEN)==> Start Test$(RESET)"
# yarn cypress:open
#
# .PHONY: start-test-all
# start-test-all: ## Start Test
# @echo "$(GREEN)==> Start Test$(RESET)"
# yarn ci:cypress:run
#
# .PHONY: all start test-acceptance