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-07-04 14:17:41 +08:00
|
|
|
.PHONY: all
|
2017-06-09 02:54:12 +08:00
|
|
|
all: build
|
2017-06-08 07:43:25 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: build
|
2017-06-09 02:54:12 +08:00
|
|
|
build:
|
2017-07-14 02:56:17 +08:00
|
|
|
@composer install --no-interaction
|
|
|
|
@php artisan optimize
|
|
|
|
@php artisan config:cache
|
2017-06-09 11:50:22 +08:00
|
|
|
@make db
|
2017-06-09 02:28:26 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: install
|
2017-06-12 00:36:16 +08:00
|
|
|
install: db
|
2017-06-09 09:02:52 +08:00
|
|
|
echo ""
|
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: clean
|
2017-06-21 07:49:45 +08:00
|
|
|
clean:
|
2017-06-25 03:00:56 +08:00
|
|
|
@php artisan cache:clear
|
2017-06-12 00:36:16 +08:00
|
|
|
@php artisan optimize
|
2017-06-12 04:37:57 +08:00
|
|
|
@php artisan route:clear
|
2017-06-12 00:36:16 +08:00
|
|
|
@php artisan config:clear
|
2017-06-21 07:49:45 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: reset
|
2017-06-21 07:49:45 +08:00
|
|
|
reset: clean
|
2017-07-14 02:45:59 +08:00
|
|
|
@php artisan database:create --reset
|
2017-06-25 01:59:07 +08:00
|
|
|
@php artisan migrate:refresh --seed
|
2017-06-12 00:36:16 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: db
|
2017-06-09 09:02:52 +08:00
|
|
|
db:
|
2017-07-14 02:56:17 +08:00
|
|
|
@php artisan database:create --reset
|
|
|
|
@php artisan migrate:refresh --seed
|
2017-06-09 09:02:52 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: unittest-db
|
2017-06-10 11:19:17 +08:00
|
|
|
unittest-db:
|
2017-06-14 08:53:02 +08:00
|
|
|
-@rm -f database/unittest.sqlite
|
2017-06-10 11:19:17 +08:00
|
|
|
sqlite3 database/unittest.sqlite ""
|
2017-06-14 08:53:02 +08:00
|
|
|
php artisan migrate:refresh --env unittest
|
2017-06-10 11:19:17 +08:00
|
|
|
|
2017-07-05 02:09:44 +08:00
|
|
|
.PHONY: tests
|
2017-06-09 12:05:22 +08:00
|
|
|
tests: test
|
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: test
|
2017-06-09 12:00:30 +08:00
|
|
|
test:
|
2017-07-14 04:43:56 +08:00
|
|
|
#php artisan database:create --reset
|
|
|
|
vendor/bin/phpunit --debug --verbose
|
2017-06-09 12:00:30 +08:00
|
|
|
|
2017-08-19 01:02:32 +08:00
|
|
|
.PHONY
|
|
|
|
sass-watch:
|
|
|
|
sass --watch public/assets/admin/sass/paper-dashboard.scss:public/assets/admin/css/paper-dashboard.css
|
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: schema
|
2017-06-09 02:54:12 +08:00
|
|
|
schema:
|
2017-06-12 00:36:16 +08:00
|
|
|
#php artisan infyom:scaffold Aircraft --fieldsFile=database/schema/aircraft.json
|
2017-06-09 09:02:52 +08:00
|
|
|
echo ""
|
2017-06-09 02:54:12 +08:00
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: docker
|
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
|
|
|
|
|
2017-07-04 14:17:41 +08:00
|
|
|
.PHONY: docker-clean
|
2017-06-08 07:43:25 +08:00
|
|
|
docker-clean:
|
|
|
|
-docker stop phpvms
|
|
|
|
-docker rm -rf phpvms
|
|
|
|
-rm core/local.config.php
|
|
|
|
-rm -rf tmp/mysql
|