forked from zestedesavoir/zds-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
145 lines (108 loc) · 4.11 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
.PHONY: fixtures
all: help
# install
## linux
install-debian:
sudo apt-get install git python3-dev python3-setuptools libxml2-dev python3-lxml libxslt-dev libz-dev python3-sqlparse libjpeg62-turbo libjpeg62-turbo-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip build-essential
install-ubuntu:
sudo apt-get install git python3-dev python3-setuptools libxml2-dev python3-lxml libxslt1-dev libz-dev python3-sqlparse libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev libffi-dev python3-pip build-essential
install-fedora:
sudo dnf install git python3-devel python3-setuptools libxml2-devel python3-lxml libxslt-devel zlib-devel python3-sqlparse libjpeg-turbo-devel libjpeg-turbo-devel freetype freetype-devel libffi-devel python3-pip gcc redhat-rpm-config
install-archlinux:
sudo pacman -Sy git python python-setuptools python-pip libxml2 python-lxml libxslt zlib python-sqlparse libffi libjpeg-turbo freetype2 base-devel
install-osx:
brew install gettext cairo --without-x11 py2cairo node && \
pip install virtualenv virtualenvwrapper
# dev back
## django
generate-pdf:
python manage.py generate_pdf
migrate:
python manage.py migrate
reset:
python manage.py reset
shell:
python manage.py shell
index-all:
python manage.py es_manager index_all
index-flagged:
python manage.py es_manager index_flagged
## back-utils
clean-back:
find . -name '*.pyc' -exec rm {} \;
install-back:
pip install --upgrade -r requirements-dev.txt
lint-back:
flake8 zds
report-release-back:
python scripts/release_generator.py
run-back:
python manage.py runserver 0.0.0.0:8000
test-front:
python manage.py test --settings zds.settings_test_local --tag=front
test-back:
make clean-back && \
python manage.py test --settings zds.settings_test_local --exclude-tag=front
# front
## front-utils
build-front:
yarn run build
clean-front:
yarn run clean
install-front:
yarn
lint-front:
yarn run lint
watch-front:
yarn run gulp
# generic utils
clean: clean-back clean-front
wipe:
rm base.db
rm -rf contents-private/*
rm -rf contents-public/*
doc:
cd doc && \
make html
fixtures:
python manage.py loaddata fixtures/*.yaml
python manage.py load_factory_data fixtures/advanced/aide_tuto_media.yaml
restart_db: wipe migrate fixtures
python manage.py load_fixtures --size=low --all
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " build-front to build frontend code"
@echo " doc to generate the html documentation"
@echo " fixtures to load every fixtures"
@echo " generate-pdf to regenerate all PDFs"
@echo " index-all to setup and (re)index all things for search"
@echo " index-flagged to index flagged things for search"
@echo " help to get this help"
@echo " install-back to install backend dependencies"
@echo " install-front to install frontend dependencies"
@echo " install-debian to install debian dependencies"
@echo " install-ubuntu to install ubuntu dependencies"
@echo " install-fedora to install fedora dependencies"
@echo " install-archlinux to install archlinux dependencies"
@echo " install-osx to install os x dependencies"
@echo " lint-back to lint backend code (flake8)"
@echo " lint-front to lint frontend code (jshint)"
@echo " clean-back to clean *.pyc"
@echo " clean-front to clean frontend builds"
@echo " clean to clean everything"
@echo " wipe to clean data (database and contents)"
@echo " watch-front to watch frontend code"
@echo " migrate to migrate the project"
@echo " report-release-back to generate release report"
@echo " run to run the project locally"
@echo " run-back to only run the backend"
@echo " shell to get django shell"
@echo " test to run django tests"
@echo "Open this Makefile to see what each target does."
@echo "When a target uses an env variable (eg. $$(VAR)), you can do"
@echo " make VAR=my_var cible"
install: install-back install-front
lint: lint-back lint-front
run:
make -j2 watch-front run-back
test: test-back test-front