-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (52 loc) · 2.05 KB
/
Makefile
File metadata and controls
67 lines (52 loc) · 2.05 KB
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
help:
@echo "make requirements: installs java/maven/node/... on your system"
@echo "make env: create conda environment"
@echo "make neo4j: run neo4j"
@echo "make build: builds this project"
@echo "make update: updates the conda environment"
@echo "make start: runs this project"
requirements:
make -f Requirements.mk all
env:
conda env create -f environment.yml
neo4j:
sudo neo4j start
build:
cd frontend && \
if [ -d "node_modules" ]; then rm -r node_modules; fi && \
if [ -f "package-lock.json" ]; then rm package-lock.json; fi && \
npm install && \
npm run build && \
cd ../backend/gephi && \
mvn install
update:
conda env update --file environment.yml --prune
start:
echo "remember to activate your conda environment with 'conda activate pgdb'"
echo "remember to start neo4j with 'make neo4j'"
cd backend/src; sudo env "PATH=$$PATH" python main.py
deployment:
sudo kill `cat backend/src/process.pid` > /home/ubuntu/logs/kill.log 2>&1 || true
$(MAKE) update > /home/ubuntu/logs/update.log 2>&1
$(MAKE) build > /home/ubuntu/logs/build.log 2>&1
cd backend/src; nohup sudo env "PATH=$$PATH" python main.py --pid > /home/ubuntu/logs/server.log 2>&1
restart:
sudo kill `cat backend/src/process.pid` > /home/ubuntu/logs/kill.log 2>&1 || true
cd backend/src; nohup sudo env "PATH=$$PATH" python main.py --pid > /home/ubuntu/logs/server.log 2>&1
.PHONY: test format check-format all frontend-audit backend-test
# Run all tests (frontend + backend + formatting check)
test: frontend-audit backend-test check-format
# Frontend security audit
frontend-audit:
cd frontend && npm audit --audit-level high
# Backend unit tests
backend-test:
python -m unittest discover backend
# Check Python formatting without modifying files
check-format:
black --check -l 120 --target-version=py311 . --exclude "frontend/node_modules|venv|build|dist"
# Automatically fix Python formatting issues
format:
find . -name "*.py" | xargs black -l 120 --target-version=py311
# Run everything (check formatting, frontend audit, backend tests)
all: test