|
1 | | -SHELL = /bin/bash |
2 | | -SUPERVISORD=FLAGS=$$FLAGS supervisord -c baselayer/conf/supervisor/supervisor.conf |
3 | | -SUPERVISORCTL=FLAGS=$$FLAGS supervisorctl -c baselayer/conf/supervisor/supervisor.conf |
4 | | -ENV_SUMMARY=PYTHONPATH=. ./baselayer/tools/env_summary.py $$FLAGS |
5 | | -ESLINT=./node_modules/.bin/eslint |
6 | | - |
7 | 1 | .DEFAULT_GOAL := run |
8 | 2 |
|
9 | | -bundle = ./static/build/bundle.js |
10 | | -webpack = ./node_modules/.bin/webpack |
11 | | -baselayer_branch = $(shell git config -f .gitmodules submodule.baselayer.branch) |
12 | | - |
13 | 3 | baselayer/README.md: |
14 | 4 | git submodule update --init --remote |
15 | 5 | $(MAKE) baselayer-update |
16 | 6 |
|
17 | | -.PHONY: baselayer-update |
| 7 | +.PHONY: baselayer-update run log |
18 | 8 | baselayer-update: |
19 | 9 | ./baselayer/tools/submodule_update.sh |
20 | 10 |
|
21 | | -dependencies: baselayer/README.md |
22 | | - @./baselayer/tools/silent_monitor.py pip install -r baselayer/requirements.txt |
23 | | - @./baselayer/tools/silent_monitor.py pip install -r requirements.txt |
24 | | - @./baselayer/tools/silent_monitor.py ./baselayer/tools/check_js_deps.sh |
25 | | - |
26 | | -db_init: |
27 | | - @PYTHONPATH=. ./baselayer/tools/silent_monitor.py ./baselayer/tools/db_init.py |
28 | | - |
29 | | -db_clear: |
30 | | - PYTHONPATH=. ./baselayer/tools/db_init.py -f |
31 | | - |
32 | | -$(bundle): webpack.config.js package.json |
33 | | - $(webpack) |
34 | | - |
35 | | -bundle: $(bundle) |
36 | | - |
37 | | -bundle-watch: |
38 | | - $(webpack) -w |
| 11 | +log: |
| 12 | + make -C baselayer log |
39 | 13 |
|
40 | | -paths: |
41 | | - @mkdir -p log run tmp |
42 | | - @mkdir -p log/sv_child |
43 | | - @mkdir -p ~/.local/cesium/logs |
| 14 | +run: |
| 15 | + make -C baselayer run |
44 | 16 |
|
45 | | -fill_conf_values: |
46 | | - PYTHONPATH=. ./baselayer/tools/fill_conf_values.py |
47 | | - |
48 | | -log: paths |
49 | | - ./baselayer/tools/watch_logs.py |
50 | | - |
51 | | -run: paths dependencies fill_conf_values |
52 | | - @echo "Supervisor will now fire up various micro-services." |
53 | | - @echo |
54 | | - @echo " - Run \`make log\` in another terminal to view logs" |
55 | | - @echo " - Run \`make monitor\` in another terminal to restart services" |
56 | | - @echo |
57 | | - @echo "The server is in debug mode:" |
58 | | - @echo " JavaScript and Python files will be reloaded upon change." |
59 | | - @echo |
60 | | - |
61 | | - @FLAGS="--debug" && \ |
62 | | - $(ENV_SUMMARY) && echo && \ |
63 | | - echo "Press Ctrl-C to abort the server" && \ |
64 | | - echo && \ |
65 | | - $(SUPERVISORD) |
| 17 | +run_testing: |
| 18 | + make -C baselayer run_testing |
66 | 19 |
|
67 | 20 | run_production: |
68 | | - export FLAGS="--config config.yaml" && \ |
69 | | - $(ENV_SUMMARY) && \ |
70 | | - $(SUPERVISORD) |
71 | | - |
72 | | -run_testing: paths dependencies |
73 | | - export FLAGS="--config _test_config.yaml" && \ |
74 | | - $(ENV_SUMMARY) && \ |
75 | | - $(SUPERVISORD) |
76 | | - |
77 | | -monitor: |
78 | | - @echo "Entering supervisor control panel." |
79 | | - @echo " - Type \`status\` too see microservice status" |
80 | | - $(SUPERVISORCTL) -i status |
| 21 | + make -C baselayer run_production |
81 | 22 |
|
82 | | -# Attach to terminal of running webserver; useful to, e.g., use pdb |
83 | | -attach: |
84 | | - $(SUPERVISORCTL) fg app |
| 23 | +test: |
| 24 | + make -C baselayer test |
85 | 25 |
|
86 | | -clean: |
87 | | - rm $(bundle) |
| 26 | +test_headless: |
| 27 | + make -C baselayer test_headless |
88 | 28 |
|
89 | | -test_headless: paths dependencies fill_conf_values |
90 | | - PYTHONPATH='.' xvfb-run ./tools/test_frontend.py |
91 | | - |
92 | | -test: paths dependencies fill_conf_values |
93 | | - PYTHONPATH='.' ./tools/test_frontend.py |
94 | | - |
95 | | -stop: |
96 | | - $(SUPERVISORCTL) stop all |
| 29 | +db_init: |
| 30 | + make -C baselayer db_init |
97 | 31 |
|
98 | | -status: |
99 | | - PYTHONPATH='.' ./baselayer/tools/supervisor_status.py |
| 32 | +db_clear: |
| 33 | + make -C baselayer db_clear |
100 | 34 |
|
101 | 35 | docker-images: |
102 | 36 | # Add --no-cache flag to rebuild from scratch |
103 | 37 | docker build -t cesium/web . && docker push cesium/web |
104 | 38 |
|
105 | | -# Call this target to see which Javascript dependencies are not up to date |
106 | | -check-js-updates: |
107 | | - ./baselayer/tools/check_js_updates.sh |
| 39 | +-include "baselayer/README.md" # always clone baselayer if it doesn't exist |
0 commit comments