-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
89 lines (59 loc) · 2.18 KB
/
makefile
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
#!/usr/bin/make
# choco install make
.DEFAULT_GOAL := help
##@ Initialize work
init: ## Start a new development environment
cp .env.example .env
$(MAKE) dev
@sleep 10
$(MAKE) keys
$(MAKE) install
$(MAKE) migrate
##@ Docker actions
dev: ## Start containers detached
docker compose up -d
keys: ## Generate secret keys
docker compose exec nginx bash -c "su -c 'php artisan key:generate' application"
logs: ## Show the output logs
docker compose logs
log: ## Open the logs and follow the news
docker compose logs --follow
restart: ## Restart the app container
docker compose down
docker compose up -d
up: ## Put the project UP
docker compose up -d
down: ## Put the project DOWN
docker compose down
unlog: ## Clear log file
docker compose exec nginx bash -c "echo '' > storage/logs/laravel.log"
tinker: ## Start tinker
docker compose exec --user application nginx bash -c "php artisan tinker"
##@ Bash shortcuts
bash: ## Enter bash nginx container
docker compose exec --user application nginx bash
nginx: ## Enter bash nginx container
docker compose exec --user application nginx bash
mysql: ## Enter bash mysql container
docker compose exec mysql bash
##@ Database tools
migration: ## Create migration file
docker compose exec --user application nginx bash -c "php artisan make:migration $(name)"
migrate: ## Perform migrations
docker compose exec --user application nginx php artisan migrate
fresh: ## Perform migrations
docker compose exec --user application nginx php artisan migrate:fresh
rollback: ## Rollback migration
docker compose exec --user application nginx php artisan migrate:rollback
backup: ## Export database
docker compose exec mysql bash -c "/var/www/app/.scripts/backup.sh"
##@ Composer
install: ## Composer install dependencies
docker compose exec nginx bash -c "su -c \"composer install\" application"
update: ## Composer install dependencies
docker compose exec --user application nginx bash -c "composer update"
autoload: ## Run the composer dump
docker compose exec --user application nginx bash -c "composer dump-autoload"
##@ General commands
route: ## List the routes of the app
docker compose exec --user application nginx php artisan route:list