-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (60 loc) · 2.5 KB
/
Makefile
File metadata and controls
73 lines (60 loc) · 2.5 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
.PHONY: help install dev-install test lint format check clean deploy
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install the package dependencies
pip install -r requirements.txt
dev-install: ## Install the package with development dependencies
pip install -r requirements-dev.txt
test: ## Run tests
pytest tests/ -v
lint: ## Run linting
ruff check bugzooka/ tests/
mypy bugzooka/
format: ## Format code
black bugzooka/ tests/
ruff format bugzooka/ tests/
check: lint test ## Run all checks
clean: ## Clean cache and temporary files
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf .ruff_cache/
rm -rf .mypy_cache/
run: ## Run BugZooka (if RAG_IMAGE set in env/.env, apply sidecar overlay first)
PYTHONPATH=. python bugzooka/entrypoint.py $(ARGS)
podman-build: ## Build podman image
podman build -t bugzooka:latest .
podman-run: ## Run podman container
podman run -d \
-e ENABLE_INFERENCE=true \
-v ./.env:/app/.env:Z \
bugzooka:latest
deploy: ## Deploy to OpenShift (uses overlays/rag if RAG_IMAGE provided, overlays/chatbot if CHATBOT is true)
@set -a; \
if [ -f .env ]; then . ./.env; fi; \
set +a; \
if [ -n "$$RAG_IMAGE" ]; then \
echo "Deploying with RAG overlay (RAG_IMAGE=$$RAG_IMAGE)"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/overlays/rag | envsubst | oc apply -f -; \
elif [ "$$CHATBOT" = "true" ]; then \
echo "Deploying with chatbot overlay"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/overlays/chatbot | envsubst | oc apply -f -; \
else \
echo "Deploying base default overlay"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/base | envsubst | oc apply -f -; \
fi
undeploy:
@set -a; \
if [ -f .env ]; then . ./.env; fi; \
set +a; \
if [ -n "$$RAG_IMAGE" ]; then \
echo "Deploying with RAG overlay (RAG_IMAGE=$$RAG_IMAGE)"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/overlays/rag | envsubst | oc delete -f -; \
elif [ "$$CHATBOT" = "true" ]; then \
echo "Deploying with chatbot overlay"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/overlays/chatbot | envsubst | oc delete -f -; \
else \
echo "Deploying base default overlay"; \
kustomize build --load-restrictor=LoadRestrictionsNone ./kustomize/base | envsubst | oc delete -f -; \
fi