-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (84 loc) · 3.23 KB
/
Makefile
File metadata and controls
114 lines (84 loc) · 3.23 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
# Makefile for Re:do Laravel Docker Setup
# Provides convenient shortcuts for Docker operations
.PHONY: help setup start stop restart logs build clean artisan deploy status backup
# Default target
help: ## Show this help message
@echo "Re:do Laravel Docker Commands"
@echo "============================="
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
setup: ## Initial setup of the application
@./scripts/docker-setup.sh setup
start: ## Start all containers
@./scripts/docker-setup.sh start
stop: ## Stop all containers
@./scripts/docker-setup.sh stop
restart: ## Restart all containers
@./scripts/docker-setup.sh restart
logs: ## View logs from all containers
@./scripts/docker-setup.sh logs
build: ## Build all containers
@./scripts/docker-setup.sh build
clean: ## Clean up containers, volumes, and images
@./scripts/docker-setup.sh clean
# Laravel specific commands
artisan: ## Run Laravel artisan command (usage: make artisan cmd="migrate")
@./scripts/docker-artisan.sh $(cmd)
migrate: ## Run database migrations
@./scripts/docker-artisan.sh migrate
migrate-fresh: ## Fresh migration with seeding
@./scripts/docker-artisan.sh migrate:fresh --seed
cache-clear: ## Clear all caches
@./scripts/docker-artisan.sh cache:clear
@./scripts/docker-artisan.sh config:clear
@./scripts/docker-artisan.sh route:clear
@./scripts/docker-artisan.sh view:clear
tinker: ## Start Laravel tinker
@./scripts/docker-artisan.sh tinker
# Production commands
deploy: ## Deploy to production
@./scripts/docker-deploy.sh deploy
prod-status: ## Show production status
@./scripts/docker-deploy.sh status
prod-logs: ## Show production logs
@./scripts/docker-deploy.sh logs
backup: ## Create backup
@./scripts/docker-deploy.sh backup
# Development helpers
shell: ## Access application container shell
@docker-compose exec app bash
mysql: ## Access MySQL CLI
@docker-compose exec mysql mysql -u redo_user -p redo
redis: ## Access Redis CLI
@docker-compose exec redis redis-cli
npm: ## Run npm command (usage: make npm cmd="install")
@docker-compose exec vite npm $(cmd)
composer: ## Run composer command (usage: make composer cmd="install")
@docker-compose exec app composer $(cmd)
# Testing
test: ## Run tests
@./scripts/docker-artisan.sh test
test-coverage: ## Run tests with coverage
@./scripts/docker-artisan.sh test --coverage-clover=coverage.xml --coverage-html=coverage-html --coverage-text=coverage.txt
test-coverage-report: ## Run tests with coverage and show report
@./scripts/docker-artisan.sh test --coverage-clover=coverage.xml --coverage-html=coverage-html --coverage-text=coverage.txt
@echo "Coverage report generated:"
@echo "- XML: coverage.xml"
@echo "- HTML: coverage-html/index.html"
@echo "- Text: coverage.txt"
# Monitoring
ps: ## Show container status
@docker-compose ps
stats: ## Show container resource usage
@docker stats --no-stream
# Quick development workflow
dev: start ## Start development environment
@echo "Development environment started!"
@echo "Web App: http://localhost:8080"
@echo "Vite: http://localhost:5173"
fresh: ## Fresh start with clean database
@make stop
@make start
@sleep 10
@make migrate-fresh
@echo "Fresh environment ready!"