forked from allo-/ffprofile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (63 loc) · 1.62 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
SHELL = bash
.ONESHELL:
.PHONY: run
run:
@echo Run server
. venv/bin/activate
./project/manage.py runserver
.PHONY: install
install: remove
@echo Create python virtual environment
python3 -m venv venv
. venv/bin/activate
@echo Install dependencies
pip install -r requirements.txt
make -s create-project
.PHONY: create-project
create-project:
@echo Create django project
django-admin.py startproject project
@echo Create symlink
ln -s ${CURDIR} project/profilemaker
@echo Edit "'project/project/settings.py'"
printf '%s\n' \
"" \
"INSTALLED_APPS = [" \
" 'django.contrib.admin'," \
" 'django.contrib.auth'," \
" 'django.contrib.contenttypes'," \
" 'django.contrib.sessions'," \
" 'django.contrib.messages'," \
" 'django.contrib.staticfiles'," \
" 'profilemaker'," \
"]" \
>> project/project/settings.py
@echo Edit "'project/project/urls.py'"
printf '%s\n' \
"" \
"from django.conf.urls import include, url" \
"from django.contrib.staticfiles.urls import staticfiles_urlpatterns" \
"" \
"urlpatterns = [" \
" url(r'', include(\"profilemaker.urls\"))," \
"] + urlpatterns + staticfiles_urlpatterns()" \
>> project/project/urls.py
@echo Init db
cd project
./manage.py migrate
.PHONY: remove
remove:
@echo "Erase 'venv' & 'project' directories"
rm -rf venv project
.PHONY: up
up:
docker run -d --rm --name profilemaker -p 8000:8000 -v ${PWD}/extensions:/code/extensions firefox-profilemaker:latest
.PHONY: down
down:
docker stop profilemaker
.PHONY: build
build:
docker build . -t firefox-profilemaker:latest
.PHONY: shell
shell:
docker exec -it profilemaker /bin/sh