-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (56 loc) · 1.33 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
PHP_IMAGE := wpengine/php
PHP_VERSION := 7.2
COMPOSER_IMAGE := skypress/wp-composer
COMPOSER_VERSION := latest
USER_GROUP := www-data
CURRENT_USER := $(shell whoami)
default: lint
lint: lint-php
clean: file-own file-perms
install: composer-install file-own file-perms
update: composer-update file-own file-perms
lint-php:
@echo
# Running php -l
@docker run --rm \
--volume $(PWD):/workspace \
--workdir /workspace \
$(PHP_IMAGE):$(PHP_VERSION) \
/bin/bash -c 'find . \
-not \( -path "*/vendor" -prune \) \
-name \*.php \
-print0 | \
xargs -I {} -0 php -l {}'
@echo
# Linted PHP files
file-perms:
@echo
# Setting proper file permissions
sudo find . -type d -exec chmod 775 {} \;
sudo find . -type f -exec chmod 664 {} \;
@echo
# File permissions set
file-own:
@echo
# Changing ownership project files
sudo chown -R $(CURRENT_USER):$(USER_GROUP) $(PWD)
@echo
# Ownsership set
composer-install:
@echo
# Installing packages from composer.json
@docker run --rm \
--volume $(PWD):/app \
$(COMPOSER_IMAGE):$(COMPOSER_VERSION) \
composer install -o
@echo
# Finished install packages
composer-update:
@echo
# Installing packages from composer.json
@docker run --rm \
--volume $(PWD):/app \
$(COMPOSER_IMAGE):$(COMPOSER_VERSION) \
composer update -o
@echo
# Finished install packages