-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (24 loc) · 904 Bytes
/
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
SHELL = /bin/bash
DUMP_FILE = .tmp/all-databases.sql
default:
@make docker-up
@make wait-for-it
@echo Now open: 'http://127.0.0.1:3051'
docker-up:
docker-compose up -d
docker-down:
docker-compose down
clean:
docker-compose down -v
wait-for-it: docker-up
docker-compose exec -T snipe-mysql /scripts/wait-for-it.sh 127.0.0.1:3306
dump: wait-for-it
@mkdir -p $(shell dirname '$(DUMP_FILE)')
docker-compose exec -T snipe-mysql sh -c 'exec mysqldump --all-databases -uroot -proot' > $(DUMP_FILE)
restore: wait-for-it
docker-compose exec -T snipe-mysql sh -c 'exec mysql -uroot -proot' < $(DUMP_FILE)
snipe-it-bash: wait-for-it
docker-compose exec snipe-it bash
snipe-it-throttle: wait-for-it
@(echo '$(limit)' | grep -q -E '^[0-9]+$$') || (>&2 echo 'invalid limit must be integer'; exit 1)
docker-compose exec snipe-it sed -i'' s/throttle:[0-9]\\+/throttle:$(limit)/ app/Http/Kernel.php