-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (35 loc) · 1.07 KB
/
Makefile
File metadata and controls
42 lines (35 loc) · 1.07 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
.PHONY: dev install clean force-dev migrate-dev migrate-deploy studio
install:
npm install
cd api && npm install && npm run build
cd web && npm install && npm run build
dev:
npm run dev
clean:
rm -rf node_modules
rm -rf api/node_modules api/dist
rm -rf web/node_modules web/.nuxt web/.output
# Comando para matar processos em portas específicas e iniciar o ambiente dev
force-dev:
@echo "🔄 Parando serviços existentes..."
@echo "Matando processos nas portas 4000 e 3001..."
-sudo fuser -k -n tcp 4000 3001 2>/dev/null || true
@sleep 2
@echo "✅ Portas liberadas"
@echo "🐘 Verificando PostgreSQL..."
@if systemctl is-active --quiet postgresql; then \
echo "✅ PostgreSQL já está rodando"; \
else \
echo "🔄 Iniciando PostgreSQL..."; \
sudo systemctl start postgresql; \
sleep 2; \
fi
@echo "✅ PostgreSQL verificado"
@sleep 2
@make dev
migrate-dev:
cd api && npx dotenv -e ../.env -- npx prisma migrate dev
migrate-deploy:
cd api && npx dotenv -e ../.env -- npx prisma migrate deploy
studio:
cd api && npx dotenv -e ../.env -- npx prisma studio