forked from dersonsena/yii2-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
30 lines (21 loc) · 842 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
#!make
include .env
export $(shell sed 's/=.*//' .env)
install:
docker exec -it ${DOCKER_APP_SERVICE_NAME} composer install -o
require:
docker exec -it ${DOCKER_APP_SERVICE_NAME} composer require ${PACKAGE}
dump:
docker exec -it ${DOCKER_APP_SERVICE_NAME} composer dump-autoload
migrate:
docker exec -it ${DOCKER_APP_SERVICE_NAME} yii migrate
migrate-create:
docker exec -it ${DOCKER_APP_SERVICE_NAME} yii migrate/create ${NAME}
migrate-down:
docker exec -it ${DOCKER_APP_SERVICE_NAME} yii migrate/down
cache-clear:
docker exec -it ${DOCKER_APP_SERVICE_NAME} yii cache/flush-all
db-backup:
docker exec ${DOCKER_DB_SERVICE_NAME} /usr/bin/mysqldump -u root -p${DB_PASSWORD} ${DB_DATABASE} > backup.sql
db-restore:
cat backup.sql | docker exec -i ${DOCKER_DB_SERVICE_NAME} /usr/bin/mysql -u root -p${DB_PASSWORD} ${DB_DATABASE}