-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
57 lines (46 loc) · 1.72 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
.PHONY: all
info: usage
usage:
@echo " make init Initialise the project for development."
@echo " make rebuild Rebuild the the project for development."
@echo " make start Start the the project for development."
@echo " make stop Stop the the project for development."
@echo " make update-project Update the projects local dependencies."
@echo " make migrate Run database migrations."
@echo " make logs See the Docker logs."
init: do_init do_up do_migrate
rebuild: do_down do_up do_migrate
start: do_start
stop: do_stop
update-project: do_updates do_migrate
migrate: do_migrate
logs: do_logs
do_init:
test -f ./.env || cp ./.env.example ./.env
composer install --prefer-dist --ignore-platform-reqs --no-suggest --no-scripts
npm install
npm run dev
docker-compose build
grep -q "APP_KEY=ThisWillBeAutoGeneratedAfterFirstBoot" .env && docker-compose exec app php artisan key:generate; exit 0 || echo "Skipping artisan key generation"
do_up:
touch storage/logs/laravel.log
chmod 0666 storage/logs/laravel.log
chmod -R 0777 storage
find storage/ -type f -exec chmod 0666 {} \;
docker-compose up -d --remove-orphans
docker-compose exec mariadb mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS dev; GRANT ALL PRIVILEGES ON * . * TO 'dev'@'%'; FLUSH PRIVILEGES"; exit 0
do_down:
docker-compose down
do_start:
docker-compose start
do_stop:
docker-compose stop
do_migrate:
docker-compose exec app php artisan migrate:fresh --seed; exit 0
do_updates:
composer dump-autoload
composer install --prefer-dist --ignore-platform-reqs --no-suggest --no-scripts
npm install
npm run dev
do_logs:
docker-compose logs -f