forked from mikepsinn/disease-eradication-plan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (90 loc) · 3.16 KB
/
Makefile
File metadata and controls
103 lines (90 loc) · 3.16 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
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
98
99
100
101
102
103
# Disease Eradication Plan - Makefile
# Simplifies common development tasks
.PHONY: help setup install validate render deploy deploy-economics deploy-vercel deploy-economics-vercel clean
# Default target - show help
help:
@echo "Disease Eradication Plan - Available Commands:"
@echo ""
@echo " make setup - Complete setup (create venv, install all dependencies)"
@echo " make install - Install dependencies only (assumes venv exists)"
@echo " make validate - Run pre-render validation checks"
@echo " make render - Render book to HTML"
@echo " make outline - Generate outline from all headings in chapter files"
@echo " make deploy - Build and deploy book to Netlify (production)"
@echo " make deploy-economics - Build and deploy economics site to Netlify"
@echo " make deploy-vercel - Build and deploy book to Vercel (production)"
@echo " make deploy-economics-vercel - Build and deploy economics site to Vercel"
@echo " make clean - Remove generated files (_book, .quarto)"
@echo ""
# Detect OS for venv activation
ifeq ($(OS),Windows_NT)
VENV_ACTIVATE = .venv\Scripts\activate
PYTHON = .venv\Scripts\python.exe
RM = rmdir /s /q
else
VENV_ACTIVATE = . .venv/bin/activate
PYTHON = .venv/bin/python
RM = rm -rf
endif
# Complete setup - create venv and install everything
setup:
@echo "Creating Python virtual environment..."
python -m venv .venv
@echo ""
@echo "Installing Python dependencies..."
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install -r requirements.txt
@echo ""
@echo "Installing Node.js dependencies..."
npm install
@echo ""
@echo "Setup complete! Next steps:"
@echo " - Run 'make validate' to check your changes"
@echo " - Run 'make render' to build the book"
# Install dependencies (assumes venv already exists)
install:
@echo "Installing Python dependencies..."
$(PYTHON) -m pip install -r requirements.txt
@echo ""
@echo "Installing Node.js dependencies..."
npm install
@echo ""
@echo "Dependencies installed!"
# Run validation checks
validate:
@echo "Running pre-render validation..."
$(PYTHON) scripts/pre-render-validation.py
# Render the book to HTML
render:
@echo "Rendering book..."
quarto render
# Generate outline from headings
outline:
@echo "Generating outline from chapter headings..."
$(PYTHON) scripts/generate-outline.py --output OUTLINE-GENERATED.MD
# Build and deploy to Netlify
deploy:
@echo "Building and deploying book to Netlify..."
$(PYTHON) scripts/deploy-book-to-netlify.py
# Build and deploy economics site to Netlify
deploy-economics:
@echo "Building and deploying economics site to Netlify..."
$(PYTHON) scripts/deploy-economics-to-netlify.py
# Build and deploy book to Vercel
deploy-vercel:
@echo "Building and deploying book to Vercel..."
$(PYTHON) scripts/deploy-book-to-vercel.py
# Build and deploy economics site to Vercel
deploy-economics-vercel:
@echo "Building and deploying economics site to Vercel..."
$(PYTHON) scripts/deploy-economics-to-vercel.py
# Clean generated files
clean:
@echo "Cleaning generated files..."
ifeq ($(OS),Windows_NT)
if exist _book $(RM) _book
if exist .quarto $(RM) .quarto
else
$(RM) _book .quarto
endif
@echo "Clean complete!"