prole/Makefile
chrisfu 1573bb59c2 Add prole.spec and extend OpenTofu k3s configuration
- Include new `prole.spec` for build configurations and dependencies.
- Add Terraform state handling for OpenTofu in `k3s` cluster.
- Provision multiple Kubernetes resources in `prole-db` namespace: namespace, services, ConfigMaps, StatefulSets, Ingress rules, and PersistentVolumes.
- Integrate deployment and configuration enhancements for `garage`, `prole`, and related components.
2026-02-24 21:47:02 -08:00

62 lines
1.9 KiB
Makefile

# Makefile for Prole Database Deployment and Installer
ifneq ($(wildcard bin/python3),)
PYTHON ?= bin/python3
else
PYTHON ?= python3
endif
PYINSTALLER = $(PYTHON) -m PyInstaller
DIST_DIR = dist
BUILD_DIR = build
PROLE_CONF ?= conf
.PHONY: all prole install deploy clean help requirements
all: prole
help:
@echo "Prole Build & Deployment System"
@echo ""
@echo "Targets:"
@echo " prole - Build the 'prole' CLI binary (ncurses/silent only)"
@echo " requirements - Install Python dependencies"
@echo " install - Run silent install via prole.sh"
@echo " deploy - Run infrastructure deployment via OpenTofu"
@echo " clean - Remove build artifacts"
@echo ""
@echo "Environment:"
@echo " PROLE_CONF - Directory containing prole.cfg (default: conf)"
requirements:
@echo "Installing dependencies..."
$(PYTHON) -m pip install -r prole_requirements.txt
prole:
@$(PYTHON) -c "import PyInstaller" 2>/dev/null || (echo "Error: PyInstaller not found. Please run 'make requirements' or install it with: $(PYTHON) -m pip install -r prole_requirements.txt" && exit 1)
@echo "Building 'prole' CLI binary (excluding Tk UI)..."
$(PYINSTALLER) --clean --noconfirm --onefile \
--name prole \
--exclude-module tkinter \
--exclude-module _tkinter \
--exclude-module Tkinter \
--add-data "etc:etc" \
--add-data "prole-net:prole-net" \
--add-data "k8s:k8s" \
--add-data "conf:conf" \
prole/cli.py
@echo "✓ Build complete: $(DIST_DIR)/prole"
install:
@echo "Running silent install..."
PROLE_CONF=$(PROLE_CONF) ./prole.sh install -s -c $(PROLE_CONF)/prole.cfg
deploy:
@echo "Running Prole deployment (OpenTofu)..."
PYTHONPATH=$(CURDIR) PROLE_CONF=$(PROLE_CONF) $(PYTHON) prole/cli.py deploy
clean:
@echo "Cleaning build artifacts..."
rm -rf $(BUILD_DIR) $(DIST_DIR) *.spec
rm -rf __pycache__ prole/__pycache__ installer/__pycache__
@echo "✓ Clean complete"