-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile
90 lines (79 loc) · 2.45 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
##############################################################################
# - Run:
#
# make
# make start
#
# - Go to:
#
# http://localhost:8080
#
# - Create a new Plone Site (admin:admin)
# - Install "EEA Faceted Navigation" via "Site Setup > Add-ons"
# - Add new "Folder" and "Enable Faceted Navigation" from "Actions" menu
#
##############################################################################
# SETUP MAKE
#
## Defensive settings for make: https://tech.davis-hansson.com/p/make/
SHELL:=bash
.ONESHELL:
# for Makefile debugging purposes add -x to the .SHELLFLAGS
.SHELLFLAGS:=-eu -o pipefail -O inherit_errexit -c
.SILENT:
.DELETE_ON_ERROR:
MAKEFLAGS+=--warn-undefined-variables
MAKEFLAGS+=--no-builtin-rules
# Colors
# OK=Green, warn=yellow, error=red
ifeq ($(TERM),)
# no colors if not in terminal
MARK_COLOR=
OK_COLOR=
WARN_COLOR=
ERROR_COLOR=
NO_COLOR=
else
MARK_COLOR=`tput setaf 6`
OK_COLOR=`tput setaf 2`
WARN_COLOR=`tput setaf 3`
ERROR_COLOR=`tput setaf 1`
NO_COLOR=`tput sgr0`
endif
##############################################################################
# SETTINGS AND VARIABLE
PLONE_VERSION?=6-latest
PYTHON?=python3.9
PIP_PARAMS=
# Top-level targets
.PHONY: all
all: clean bootstrap install develop
.PHONY: clean
clean: ## Cleanup environment
rm -rf bin etc include lib lib64 var inituser pyvenv.cfg *.egg-info node_modules
.PHONY: bootstrap
bootstrap: ## Bootstrap python environment
$(PYTHON) -m venv .
bin/pip install --upgrade pip mxdev pylint black
.PHONY: install
install: ## Install Plone
bin/pip install Paste Plone plone.volto -c "https://dist.plone.org/release/$(PLONE_VERSION)/constraints.txt" $(PIP_PARAMS)
bin/pip install zope.testrunner plone.app.testing plone.reload dm.plonepatches.reload i18ndude Products.ZMIntrospection -c "https://dist.plone.org/release/$(PLONE_VERSION)/constraints.txt" $(PIP_PARAMS)
bin/mkwsgiinstance -d . -u admin:admin
cp zope.conf etc/zope.conf
mkdir -p var/blobstorage var/filestorage
.PHONY: develop
develop: ## Develop this add-on
bin/pip install -e . $(PIP_PARAMS)
yarn install
.PHONY: start
start: ## Start Plone backend
yarn build
bin/runwsgi -v etc/zope.ini
.PHONY: test
test: ## Run tests
bin/zope-testrunner --test-path=./ --auto-progress --auto-color --verbose
.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 :)"
head -n 15 Makefile