-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathMakefile
More file actions
124 lines (94 loc) · 4.89 KB
/
Copy pathMakefile
File metadata and controls
124 lines (94 loc) · 4.89 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.PHONY: help build-minimal build-standard build-messaging build-all run-example clean test dev
# Default target
.DEFAULT_GOAL := help
VARIANT ?= minimal
WORKFLOWS ?= ./workflows
# Export variables for docker-compose
export WORKFLOWS
help: ## Show this help message
@echo "Quarkus Flow Runner - Available targets:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Variables:"
@echo " VARIANT Image variant to build (minimal|standard|messaging) [default: minimal]"
@echo " WORKFLOWS Path to workflows directory to mount [default: ./workflows]"
@echo ""
@echo "Examples:"
@echo " make build-minimal Build minimal variant"
@echo " make build-all Build all variants"
@echo " make docker-compose-up Start minimal variant"
@echo " make docker-compose-up-standard Start with PostgreSQL"
@echo " make docker-compose-up WORKFLOWS=/tmp/my-flows Mount custom workflow directory"
@echo " make dev Run in dev mode (MVStore)"
build-minimal: ## Build minimal variant (MVStore, single replica)
@./scripts/build-image.sh minimal
build-standard: ## Build standard variant (JPA + PostgreSQL + HA)
@./scripts/build-image.sh standard
build-messaging: ## Build messaging variant (JPA + PostgreSQL + Kafka + HA)
@./scripts/build-image.sh messaging
build-all: build-minimal build-standard build-messaging ## Build all image variants
build: ## Build specified variant (use VARIANT variable)
@./scripts/build-image.sh $(VARIANT)
run-example: ## Run example workflow with minimal image
@./scripts/run-example.sh
stop-example: ## Stop and remove the example container
@echo "🛑 Stopping example container..."
@docker stop flow-runner-example 2>/dev/null || true
@docker rm flow-runner-example 2>/dev/null || true
@echo "✅ Container stopped and removed"
clean: stop-example ## Clean up containers and build artifacts
@echo "🧹 Cleaning build artifacts..."
@cd ../.. && mvn clean -pl runner/app
@echo "✅ Clean complete"
test: ## Run tests
@echo "🧪 Running tests..."
@cd ../.. && mvn test -pl runner/app
dev: ## Run in development mode (Quarkus dev mode with MVStore)
@echo "🚀 Starting Quarkus in dev mode..."
@echo "📍 Open http://localhost:8080 for the dashboard"
@echo "📍 Press 'w' to open OpenAPI docs"
@echo ""
@cd ../.. && mvn quarkus:dev -pl runner/app -am
docker-compose-up: ## Start minimal variant with docker-compose
@echo "🐳 Starting minimal variant with docker-compose..."
@docker-compose up -d
@echo "✅ Runner started on http://localhost:8080"
docker-compose-down: ## Stop minimal variant docker-compose
@docker-compose down
docker-compose-up-standard: ## Start standard variant (PostgreSQL) with docker-compose
@echo "🐳 Starting standard variant with PostgreSQL..."
@docker-compose -f docker-compose-standard.yml up -d
@echo "✅ Runner started on http://localhost:8080 (with PostgreSQL)"
docker-compose-down-standard: ## Stop standard variant docker-compose
@docker-compose -f docker-compose-standard.yml down
docker-compose-up-messaging: ## Start messaging variant (PostgreSQL + Kafka) with docker-compose
@echo "🐳 Starting messaging variant with PostgreSQL + Kafka..."
@docker-compose -f docker-compose-messaging.yml up -d
@echo "✅ Runner started on http://localhost:8080 (with PostgreSQL + Kafka)"
docker-compose-down-messaging: ## Stop messaging variant docker-compose
@docker-compose -f docker-compose-messaging.yml down
docker-compose-logs: ## Show logs from docker-compose (minimal)
@docker-compose logs -f
docker-compose-logs-standard: ## Show logs from docker-compose (standard)
@docker-compose -f docker-compose-standard.yml logs -f
docker-compose-logs-messaging: ## Show logs from docker-compose (messaging)
@docker-compose -f docker-compose-messaging.yml logs -f
logs: ## Show logs from running example container
@docker logs -f flow-runner-example 2>/dev/null || echo "❌ Container 'flow-runner-example' not running"
health: ## Check health of running example container
@echo "🏥 Checking health..."
@curl -s http://localhost:8080/q/health | jq '.' || echo "❌ Container not responding"
metrics: ## Show Prometheus metrics from running container
@echo "📊 Fetching metrics..."
@curl -s http://localhost:8080/q/metrics | head -50
push-minimal: ## Push minimal image to registry
@docker push quay.io/quarkiverse/quarkus-flow-runner:latest-minimal
@echo "✅ Pushed minimal image"
push-standard: ## Push standard image to registry
@docker push quay.io/quarkiverse/quarkus-flow-runner:latest-standard
@echo "✅ Pushed standard image"
push-messaging: ## Push messaging image to registry
@docker push quay.io/quarkiverse/quarkus-flow-runner:latest-messaging
@echo "✅ Pushed messaging image"
push-all: push-minimal push-standard push-messaging ## Push all images to registry