-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
148 lines (118 loc) · 3.85 KB
/
Makefile
File metadata and controls
148 lines (118 loc) · 3.85 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
.PHONY: help install dev build test clean deploy logs seed
help:
@echo "RepoDesign - System Design Evaluation Platform"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Development:"
@echo " dev Start development environment (docker-compose.dev.yml)"
@echo " install Install all dependencies"
@echo " test Run all tests"
@echo " lint Run linters"
@echo ""
@echo "Production:"
@echo " build Build production Docker images"
@echo " up Start production environment"
@echo " down Stop all containers"
@echo " logs View container logs"
@echo ""
@echo "Database:"
@echo " migrate Run database migrations"
@echo " seed Seed database with sample data"
@echo " reset-db Reset database (WARNING: destroys data)"
@echo ""
@echo "Maintenance:"
@echo " clean Remove build artifacts and caches"
@echo " shell Open Django shell"
@echo " dbshell Open database shell"
dev:
docker-compose -f docker-compose.dev.yml up --build
dev-detached:
docker-compose -f docker-compose.dev.yml up -d --build
install:
cd repodesign-core && pip install -r requirements.txt
cd repodesign-ui && npm install
cd repodesign-admin && npm install
test:
cd repodesign-core && python manage.py test
cd repodesign-ui && npm run build
cd repodesign-admin && npm run build
test-backend:
cd repodesign-core && python manage.py test
test-frontend:
cd repodesign-ui && npm run build
lint:
cd repodesign-ui && npm run lint
cd repodesign-admin && npm run lint
build:
docker-compose build
up:
docker-compose up -d
down:
docker-compose down
restart:
docker-compose restart
logs:
docker-compose logs -f
logs-backend:
docker-compose logs -f repodesign-core
logs-frontend:
docker-compose logs -f repodesign-ui
logs-celery:
docker-compose logs -f celery-worker celery-beat
migrate:
docker-compose exec repodesign-core python manage.py migrate
makemigrations:
docker-compose exec repodesign-core python manage.py makemigrations
seed:
docker-compose exec repodesign-core python manage.py seed_data
docker-compose exec repodesign-core python manage.py create_sample_questions
seed-local:
cd repodesign-core && python manage.py seed_data && python manage.py create_sample_questions
reset-db:
docker-compose down -v
docker-compose up -d postgres redis
sleep 5
docker-compose up -d repodesign-core
docker-compose exec repodesign-core python manage.py migrate
docker-compose exec repodesign-core python manage.py seed_data
docker-compose exec repodesign-core python manage.py create_sample_questions
shell:
docker-compose exec repodesign-core python manage.py shell
dbshell:
docker-compose exec postgres psql -U repodesign -d repodesign
bash:
docker-compose exec repodesign-core bash
collectstatic:
docker-compose exec repodesign-core python manage.py collectstatic --noinput
clean:
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete
find . -type d -name 'node_modules' -prune -exec rm -rf {} \;
find . -type d -name '.next' -prune -exec rm -rf {} \;
rm -rf repodesign-core/staticfiles
rm -rf repodesign-ui/.next
rm -rf repodesign-admin/.next
clean-docker:
docker-compose down -v --rmi local
docker system prune -f
quickstart: build up migrate seed
@echo ""
@echo "==================================="
@echo "RepoDesign is now running!"
@echo "==================================="
@echo ""
@echo "Access the application at:"
@echo " - User Interface: http://localhost:3000"
@echo " - Admin Panel: http://localhost:3001"
@echo " - API: http://localhost:8000/api/v1/"
@echo ""
@echo "Default admin credentials:"
@echo " - Username: admin"
@echo " - Password: admin123"
@echo ""
deploy-k8s:
kubectl apply -k k8s/overlays/production
deploy-check:
kubectl get pods -n repodesign
kubectl get services -n repodesign