-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
51 lines (40 loc) · 2.39 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
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
all: build check_convention
clean:
rm -fr build
check_convention:
pep8 . --max-line-length=109
test-server:
PYTHONPATH=py UPSETO_JOIN_PYTHON_NAMESPACES=yes python py/rackattack/dashboard/main.py --realtimewebuiRoot $(PWD)/../realtimewebui --dashboardRoot $(PWD) --rackattackInstances Bezeq:rackattack-provider.dc1.strato,RainbowLab:10.16.104.1
test-server-local:
RACKATTACK_PROVIDER=tcp://127.0.0.1:1014@@amqp://guest:[email protected]:1013/%2F@@http://127.0.0.1:1016 PYTHONPATH=py UPSETO_JOIN_PYTHON_NAMESPACES=yes python py/rackattack/dashboard/main.py --realtimewebuiRoot $(PWD)/../realtimewebui --dashboardRoot $(PWD) --localhostRackattackProvider
test-cli:
RACKATTACK_PROVIDER=tcp://rackattack-provider:1014@tcp://rackattack-provider:1015 PYTHONPATH=py UPSETO_JOIN_PYTHON_NAMESPACES=yes python py/rackattack/dashboard/cli.py
.PHONY: build
build: build/rackattack-physical-dashboard.egg
build/rackattack-physical-dashboard.egg: py/rackattack/dashboard/main.py
-include build/rackattack-physical-dashboard.egg.dep
build/%.egg:
-mkdir $(@D)
UPSETO_JOIN_PYTHON_NAMESPACES=yes PYTHONPATH=py:../realtimewebui/py python -m upseto.packegg --entryPoint=$< --output=$@ [email protected] --compile_pyc --joinPythonNamespaces
install: build
$(call check_defined, ENV)
-sudo systemctl stop rackattack-physical-dashboard.service
-sudo mkdir -p /usr/share/rackattack-physical-dashboard/realtimewebui
sudo cp build/*.egg /usr/share/rackattack-physical-dashboard
sudo cp -r html /usr/share/rackattack-physical-dashboard/
sudo cp -r static /usr/share/rackattack-physical-dashboard/
sudo cp -r ../realtimewebui/js ../realtimewebui/html ../realtimewebui/externals /usr/share/rackattack-physical-dashboard/realtimewebui
sudo cp rackattack-physical-dashboard-$(ENV).service /usr/lib/systemd/system/rackattack-physical-dashboard.service
sudo systemctl enable rackattack-physical-dashboard.service
if ["$(DONT_START_SERVICE)" == ""]; then sudo systemctl start rackattack-physical-dashboard; fi
uninstall:
-sudo systemctl stop rackattack-physical-dashboard
-sudo systemctl disable rackattack-physical-dashboard.service
-sudo rm -fr /usr/lib/systemd/system/rackattack-physical-dashboard.service
sudo rm -fr /usr/share/rackattack-physical-dashboard