-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
97 lines (71 loc) · 2.48 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
ENV=_env
PYTHON_VERSION:=3
DEPENDENCIES_PYTHON:=requirements.txt
PYTHON:=$(ENV)/bin/python$(PYTHON_VERSION)
PIP:=$(ENV)/bin/pip$(PYTHON_VERSION)
PYTEST:=$(ENV)/bin/py.test
CONFIG_DEVELOPMENT=config.development.yaml
CONFIG_PRODUCTION=config.production.yaml
CONFIG_DIST=config.dist.yaml
help:
#
# stageOrchestration - Triggerable timed stage lighting + projector orchistration
# - install :
# - upgrade_pip : Update python dependencys
# - run : Run in development mode
# - run_production : Braudcast to Artnet3
# - test : Run unit tests
#
# Install ----------------------------------------------------------------------
.PHONY: install dependencys
dependencys: $(ENV)
install: dependencys upgrade_pip test
$(ENV):
virtualenv --no-site-packages -p python$(PYTHON_VERSION) $(ENV)
$(CONFIG_DEVELOPMENT):
cp $(CONFIG_DIST) $@
#$(CONFIG_PRODUCTION):
# cp $(CONFIG_DIST) $@
../libs/:
git clone https://github.com/calaldees/libs.git
../config-merger/:
git clone https://github.com/calaldees/config-merger.git
../multisocketServer/:
git clone https://github.com/SuperLimitBreak/multisocketServer.git
.PHONY: link_local_libs
link_local_libs: $(ENV) ../libs/ ../config-merger/ ../multisocketServer/
$(PIP) install -e ../libs/
$(PIP) install -e ../config-merger/
$(PIP) install -e ../multisocketServer/
# Python Dependencys -----------------------------------------------------------
.PHONY: upgrade_pip
upgrade_pip:
$(PIP) install --upgrade pip ; $(PIP) install --upgrade -r $(DEPENDENCIES_PYTHON)
# Build ------------------------------------------------------------------------
.PHONY: build
build:
docker build --tag superlimitbreak/stageorchestration:latest .
.PHONY: push
push:
docker push superlimitbreak/stageorchestration:latest
# Run --------------------------------------------------------------------------
.PHONY: run run_production
run: $(CONFIG_DEVELOPMENT)
$(PYTHON) server.py --config $(CONFIG_DEVELOPMENT)
run_production: $(CONFIG_PRODUCTION)
$(PYTHON) server.py --config $(CONFIG_PRODUCTION)
# Tests ------------------------------------------------------------------------
.PHONY: test
test:
$(PYTEST) --doctest-modules
.PHONY: cloc
cloc:
cloc --vcs=git
# Clean ------------------------------------------------------------------------
clean_cache:
find . -iname *.pyc -delete
find . -iname __pycache__ -delete
find . -iname .cache -delete
clean: clean_cache
rm -rf $(ENV)
#rm -rf $(CONFIG_DEVELOPMENT)