From 66f632bd991f5ffc5e304b40328c9eebff16e98e Mon Sep 17 00:00:00 2001 From: Ezra Date: Sun, 5 Apr 2026 08:06:12 +0000 Subject: [PATCH] [BURN] #830: Build automation (Makefile) --- intelligence/deepdive/Makefile | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 intelligence/deepdive/Makefile diff --git a/intelligence/deepdive/Makefile b/intelligence/deepdive/Makefile new file mode 100644 index 0000000..243b408 --- /dev/null +++ b/intelligence/deepdive/Makefile @@ -0,0 +1,67 @@ +# Deep Dive Makefile - Build Automation +# Usage: make install-deps, make test, make run-dry + +.PHONY: help install install-systemd test test-e2e run-dry clean + +VENV_PATH ?= $(HOME)/.venvs/deepdive +CONFIG ?= config.yaml +PYTHON := $(VENV_PATH)/bin/python +PIP := $(VENV_PATH)/bin/pip + +help: + @echo "Deep Dive Build Commands:" + @echo " make install - Create venv + install dependencies" + @echo " make install-systemd - Install systemd timer for daily runs" + @echo " make test - Run unit tests" + @echo " make test-e2e - Run full pipeline (dry-run)" + @echo " make run-dry - Execute pipeline --dry-run" + @echo " make run-live - Execute pipeline with live delivery" + @echo " make clean - Remove cache and build artifacts" + +install: + @echo "Creating virtual environment at $(VENV_PATH)..." + python3 -m venv $(VENV_PATH) + $(PIP) install --upgrade pip + $(PIP) install -r requirements.txt + @echo "Installing embedding model (80MB)..." + $(PYTHON) -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" + @echo "Installation complete. Run: make test-e2e" + +install-systemd: + @echo "Installing systemd timer for 06:00 daily execution..." + mkdir -p $(HOME)/.config/systemd/user + cp systemd/deepdive.service $(HOME)/.config/systemd/user/ + cp systemd/deepdive.timer $(HOME)/.config/systemd/user/ + systemctl --user daemon-reload + systemctl --user enable deepdive.timer + systemctl --user start deepdive.timer + @echo "Timer installed. Check status: systemctl --user status deepdive.timer" + +test: + @echo "Running unit tests..." + cd tests && $(PYTHON) -m pytest -v + +test-e2e: + @echo "Running end-to-end test (dry-run, last 24h)..." + $(PYTHON) pipeline.py --config $(CONFIG) --dry-run --since 24 + +run-dry: + @echo "Executing pipeline (dry-run)..." + $(PYTHON) pipeline.py --config $(CONFIG) --dry-run + +run-live: + @echo "Executing pipeline with LIVE DELIVERY..." + @read -p "Confirm live delivery to Telegram? [y/N] " confirm; \ + if [ "$$confirm" = "y" ]; then \ + $(PYTHON) pipeline.py --config $(CONFIG); \ + else \ + echo "Aborted."; \ + fi + +clean: + @echo "Cleaning cache..." + rm -rf $(HOME)/.cache/deepdive + rm -rf tests/__pycache__ + find . -type f -name "*.pyc" -delete + find . -type d -name "__pycache__" -delete + @echo "Clean complete."