-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.02 KB
/
Makefile
File metadata and controls
39 lines (32 loc) · 1.02 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
.PHONY: all setup run clean docker-build docker-run lint
# Default variables
VENDOR ?= "Example Corp"
DOMAIN ?= "example.com"
PYTHON_BIN = .venv/bin/python
all: setup
setup:
@echo "Setting up SPARK environment..."
@if [ ! -d ".venv" ]; then python3 -m venv .venv; fi
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
@echo "Building Go crawler..."
go build -o scraper scraper.go
@echo "Setup complete! Run 'make run VENDOR=\"Name\" DOMAIN=\"example.com\"' to start."
run:
@if [ ! -d ".venv" ]; then \
echo "Environment not found. Running 'make setup' first..."; \
$(MAKE) setup; \
fi
$(PYTHON_BIN) app.py "$(VENDOR)" "$(DOMAIN)"
docker-build:
@echo "Building Docker image..."
docker build -t spark:latest .
docker-run:
@echo "Running SPARK in Docker..."
docker run --rm -it --env-file .env --network host spark:latest "$(VENDOR)" "$(DOMAIN)"
clean:
@echo "Cleaning up..."
rm -rf .venv
rm -f scraper
find . -type d -name "__pycache__" -exec rm -rf {} +
@echo "Cleaned up successfully."