phpvms/Makefile

98 lines
2.3 KiB
Makefile
Raw Normal View History

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'
2017-12-14 07:03:59 +08:00
SHELL := /bin/bash
2017-06-08 07:43:25 +08:00
2017-12-14 07:03:59 +08:00
PKG_NAME := "/tmp"
2017-06-08 07:43:25 +08:00
CURR_PATH=$(shell pwd)
.PHONY: all
2017-12-08 04:27:57 +08:00
all: install
2017-06-08 07:43:25 +08:00
2017-12-08 04:27:57 +08:00
.PHONY: clean
clean:
@find bootstrap/cache -type f -not -name '.gitignore' -print0 -delete
@find storage/app/public -type f -not -name '.gitignore' -print0 -delete
@find storage/app -type f -not -name '.gitignore' -not -name public -print0 -delete
@find storage/framework/cache -type f -not -name '.gitignore' -print0 -delete
@find storage/framework/sessions -type f -not -name '.gitignore' -print0 -delete
@find storage/framework/views -type f -not -name '.gitignore' -print0 -delete
@find storage/logs -type f -not -name '.gitignore' -print0 -delete
2017-12-07 07:31:20 +08:00
@php artisan route:clear
@php artisan config:clear
2017-06-09 02:28:26 +08:00
.PHONY: clean-routes
clean-routes:
@php artisan route:clear
2017-12-08 04:27:57 +08:00
.PHONY: build
build:
2017-12-14 10:22:54 +08:00
@php composer.phar install --no-interaction
.PHONY: install
2017-12-08 04:27:57 +08:00
install: build
@php artisan database:create
@php artisan migrate --seed
@echo "Done!"
2017-06-09 09:02:52 +08:00
2017-12-07 07:31:20 +08:00
.PHONY: update
update: build
@php composer.phar dump-autoload
@php composer.phar update --no-interaction
@php artisan migrate --force
2017-12-07 07:31:20 +08:00
@echo "Done!"
.PHONY: reset
2017-06-21 07:49:45 +08:00
reset: clean
@php composer.phar dump-autoload
2017-12-07 07:31:20 +08:00
@php artisan database:create --reset
2017-12-08 04:27:57 +08:00
@php artisan migrate:refresh --seed
2017-06-09 09:02:52 +08:00
2017-07-05 02:09:44 +08:00
.PHONY: tests
2017-06-09 12:05:22 +08:00
tests: test
.PHONY: test
2017-06-09 12:00:30 +08:00
test:
#php artisan database:create --reset
vendor/bin/phpunit --debug --verbose
2017-06-09 12:00:30 +08:00
2017-08-22 02:06:10 +08:00
.PHONY: sass-watch
2017-08-19 01:02:32 +08:00
sass-watch:
sass --watch public/assets/admin/sass/paper-dashboard.scss:public/assets/admin/css/paper-dashboard.css
.PHONY: schema
2017-06-09 02:54:12 +08:00
schema:
#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-12-14 06:04:23 +08:00
.PHONY: deploy-package
deploy-package:
2017-12-14 07:10:43 +08:00
./.travis/deploy_script.sh
2017-12-14 06:04:23 +08:00
2017-12-15 11:34:11 +08:00
.PHONY: reset-installer
reset-installer:
@cp .env.dev.example .env
@make clean
mysql -uroot -e "DROP DATABASE IF EXISTS phpvms"
mysql -uroot -e "CREATE DATABASE phpvms"
.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
.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