-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
133 lines (107 loc) · 3.73 KB
/
Copy pathjustfile
File metadata and controls
133 lines (107 loc) · 3.73 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
125
126
127
128
129
130
131
132
# ActionSpec - Task Runner
# https://just.systems/
# List all available recipes
default:
@just --list
# ============================================================================
# Workspace Delegation
# ============================================================================
frontend *args:
cd frontend && just {{args}}
backend *args:
cd backend && just {{args}}
alias fe := frontend
alias be := backend
# ============================================================================
# Development
# ============================================================================
# Start development environment (Docker Compose)
dev:
@echo "🐳 Starting development environment..."
@echo "📱 Frontend: http://localhost:5173"
@echo "🔧 Backend: http://localhost:5000"
@echo ""
@echo "Press Ctrl+C to stop"
docker compose up --build
# Stop development environment
down:
docker compose down
# View development logs
logs:
docker compose logs -f
# Local development without Docker (not recommended)
dev-local:
#!/usr/bin/env bash
set -m
echo "🚀 Starting local development servers..."
echo "📱 Frontend: http://localhost:5173"
echo "🔧 Backend: http://localhost:5000"
echo ""
cleanup() {
echo ""
echo "🛑 Stopping servers..."
for pid in $(jobs -p); do
pkill -15 -P $pid 2>/dev/null || true
kill -15 $pid 2>/dev/null || true
done
sleep 1
for pid in $(jobs -p); do
pkill -9 -P $pid 2>/dev/null || true
kill -9 $pid 2>/dev/null || true
done
exit 0
}
trap cleanup INT TERM
(cd frontend && just dev </dev/null) &
(cd backend && just dev </dev/null) &
wait
# ============================================================================
# Setup & Cleanup
# ============================================================================
# Setup all workspaces
setup:
@echo "📦 Setting up all workspaces..."
@just backend setup
@just frontend install
@echo "✅ Setup complete!"
# Clean all workspaces
clean:
@just backend clean
@just frontend clean
# Check environment variables
check-env:
#!/usr/bin/env bash
[ -f ".env.local" ] && source .env.local
echo "Checking OAuth configuration..."
[ -z "${GITHUB_OAUTH_CLIENT_ID:-}" ] && echo "⚠️ GITHUB_OAUTH_CLIENT_ID not set (optional for local dev)" || echo "✓ GITHUB_OAUTH_CLIENT_ID is set"
[ -z "${FLASK_SECRET_KEY:-}" ] && echo "⚠️ FLASK_SECRET_KEY not set (optional for local dev)" || echo "✓ FLASK_SECRET_KEY is set"
echo "✓ GH_REPO=${GH_REPO:-trakrf/action-spec}"
echo "✓ SPECS_PATH=${SPECS_PATH:-infra}"
# ============================================================================
# Validation
# ============================================================================
# Lint all workspaces
lint: (frontend "lint") (backend "lint")
# Test all workspaces
test: (frontend "test") (backend "test")
# Build all workspaces
build: (frontend "build") (backend "build")
# Run all validation checks
validate: lint test build
# Alias for CI/CD
check: validate
# ============================================================================
# Docker E2E Testing
# ============================================================================
# Quick Docker test - fast iteration (~30s)
test-docker-quick:
@echo "🧪 Running quick Docker E2E test..."
@./scripts/test-docker-quick.sh
# Comprehensive Docker test - full validation (~60s)
test-docker:
@echo "🧪 Running comprehensive Docker E2E test..."
@./scripts/test-docker-local.sh
# Alias for quick test
test-e2e: test-docker-quick
# Run all tests including Docker E2E
test-all: test test-docker