forked from HelikarLab/candis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·122 lines (86 loc) · 2.31 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
-include .env
.PHONY: build
.PHONY: docs
BASEDIR = $(realpath .)
MODULE = candis
HONCHO_MANAGER = honcho_manager.py
SOURCEDIR = $(realpath $(MODULE))
DOCSDIR = $(realpath docs)
VIRTUALENV = $(VIRTUAL_ENV)
# PIPENV ?= pipenv
# PYBINARIES = $(shell pipenv --venv)/bin
# PYTHON ?= $(PYBINARIES)/python
# PIP ?= $(PYBINARIES)/pip
PYBINARIES = $(VIRTUALENV)/bin
PYTHON = $(PYBINARIES)/python
PIP = $(PYBINARIES)/pip
IPYTHON = $(PYBINARIES)/ipython
HONCHO = $(PYBINARIES)/honcho
PYTEST = $(PYBINARIES)/pytest
TWINE = $(PYBINARIES)/twine
NODE_MODULES = $(BASEDIR)/node_modules
NODEBINARIES = $(NODE_MODULES)/.bin
YARN ?= yarn
clean.py:
$(PYTHON) setup.py clean
clean:
make clean.py
rm -rf .sass-cache
clear
clean.force:
rm -rf $(BASEDIR)/node_modules
rm -rf $(DOCSDIR)/build
make clean
install:
# $(PIPENV) install --skip-lock # skip-lock flag need to be removed after pipenv update.
$(PIP) install --ignore-installed -r $(BASEDIR)/requirements.txt
$(YARN) install
$(PYTHON) setup.py develop
make clean
lock:
# Lock Dependencies
# rm -rf $(BASEDIR)/Pipfile.lock
rm -rf $(BASEDIR)/requirements.txt
rm -rf $(BASEDIR)/requirements-dev.txt
# Temporary not doing this for now.
# see - https://github.com/pypa/pipenv/issues/357
# $(PIPENV) lock --requirements > $(BASEDIR)/requirements.txt
# $(PIPENV) lock --requirements --dev > $(BASEDIR)/requirements-dev.txt
$(PIP) freeze > $(BASEDIR)/requirements.txt
upgrade:
$(YARN) upgrade
test:
make install
# $(PIPENV) shell # to activate the virtualenv of pipenv.
$(PYTEST) --cov=candis.app.server.api candis/app/server/api/tests
$(YARN) test
make clean.py
build:
$(PYTHON) -B -m builder
$(YARN) run build
make clean
docs:
cd $(DOCSDIR) && make html
sass:
$(YARN) run sass
sass.watch:
$(YARN) run sass.watch
docker.build:
docker build -t $(MODULE) $(BASEDIR)
console:
$(IPYTHON)
start:
ifeq ($(ENV), development)
$(PYTHON) $(BASEDIR)/$(HONCHO_MANAGER) --env 'dev'
else
$(PYTHON) $(BASEDIR)/$(HONCHO_MANAGER) --env 'prod'
endif
release:
ifeq ($(ENV), production)
make clean
$(PYTHON) setup.py sdist bdist_wheel
$(TWINE) upload -r candis $(BASEDIR)/dist/*
make clean
else
@echo "Unable to release. Make sure the environment is in production mode."
endif