/
Makefile
75 lines (63 loc) · 2.08 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# PHP code sniffer.
phpcs:
vendor/bin/phpcs --standard=PSR2 --extensions=php src/ public/
# PHP mess detector.
phpmd:
vendor/bin/phpmd src/,public/ text codesize,unusedcode,naming
# PHP copy/paste detector.
phpcpd:
vendor/bin/phpcpd src/ public/
phploc:
vendor/bin/phploc src/ public/
# Runs tools for code quality assurance.
check: phpmd phpcs phpcpd
# Installation for production only.
install: composer.phar
# Install dependencies.
php composer.phar install --no-dev --prefer-source --no-interaction
# Create environment file.
touch .env
# Prepare environment variables.
printf "DB_ADAPTER=mysql\n" > .env
printf "DB_PORT=3306\n" >> .env
printf "DB_NAME=\n" >> .env
printf "DB_USER=\n" >> .env
printf "DB_PASS=\n" >> .env
printf "DB_HOST=\n" >> .env
printf "APP_ENV=production\n" >> .env
# Installation for development only.
dev-install: composer.phar
# Install Composer dependencies.
php composer.phar install --prefer-source --no-interaction
# Create environment file.
touch .env
# Prepare environment variables.
printf "DEBUG=true\n" > .env
# Run database migrations.
vendor/bin/phinx migrate -c src/databases/config.php
# Install pre-commit hook.
cp pre-commit.sh .git/hooks/pre-commit
# Update for production only.
update: composer.phar
git pull
php composer.phar update --no-dev
vendor/bin/phinx migrate -c src/databases/config.php -e production
# Installation and preparation for CodeShip only.
codeship: composer.phar
# Install dependencies.
php composer.phar install --prefer-source --no-interaction
# Create environment file.
touch .env
# Run database migrations.
vendor/bin/phinx migrate -c src/databases/config.php -e codeship
# Installation and preparation for Travis only.
travis: composer.phar
# Install dependencies.
php composer.phar install --prefer-source --no-interaction
# Run database migrations.
vendor/bin/phinx migrate -c src/databases/config.php -e travis-${DB}
# Installation and preparation for Heroku only.
heroku:
vendor/bin/phinx migrate -c src/databases/config.php -e heroku-cleardb
composer.phar:
curl -sS https://getcomposer.org/installer | php