2017-06-08 07:43:25 +08:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# Create the phpvms database if needed:
|
|
|
|
# docker exec phpvms /usr/bin/mysql -uroot -e 'CREATE DATABASE phpvms'
|
|
|
|
|
|
|
|
CURR_PATH=$(shell pwd)
|
|
|
|
|
2017-06-09 02:54:12 +08:00
|
|
|
all: build
|
2017-06-08 07:43:25 +08:00
|
|
|
|
2017-06-09 02:54:12 +08:00
|
|
|
|
|
|
|
build:
|
2017-06-09 02:28:26 +08:00
|
|
|
composer install
|
|
|
|
|
|
|
|
install:
|
2017-06-09 09:02:52 +08:00
|
|
|
echo ""
|
|
|
|
|
|
|
|
db:
|
|
|
|
sqlite3 tmp/database.sqlite ""
|
|
|
|
php artisan migrate
|
|
|
|
|
|
|
|
reset-db:
|
|
|
|
rm tmp/database.sqlite
|
|
|
|
make db
|
2017-06-08 07:43:25 +08:00
|
|
|
|
2017-06-09 02:54:12 +08:00
|
|
|
schema:
|
2017-06-09 09:02:52 +08:00
|
|
|
#php artisan infyom:scaffold Airlines --fieldsFile=database/schema/airlines.json
|
|
|
|
echo ""
|
2017-06-09 02:54:12 +08:00
|
|
|
|
2017-06-08 07:43:25 +08:00
|
|
|
docker:
|
|
|
|
@mkdir -p $(CURR_PATH)/tmp/mysql
|
|
|
|
|
|
|
|
-docker rm -f phpvms
|
|
|
|
docker build -t phpvms .
|
|
|
|
docker run --name=phpvms \
|
|
|
|
-v $(CURR_PATH):/var/www/ \
|
|
|
|
-v $(CURR_PATH)/tmp/mysql:/var/lib/mysql \
|
|
|
|
-p 8080:80 \
|
|
|
|
phpvms
|
|
|
|
|
|
|
|
docker-clean:
|
|
|
|
-docker stop phpvms
|
|
|
|
-docker rm -rf phpvms
|
|
|
|
-rm core/local.config.php
|
|
|
|
-rm -rf tmp/mysql
|
2017-06-09 09:02:52 +08:00
|
|
|
|
|
|
|
.PHONY: all build install db reset-db schema docker docker-clean
|