-
Notifications
You must be signed in to change notification settings - Fork 355
/
Makefile
105 lines (86 loc) · 2.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.DEFAULT_GOAL := help
PHP_VERSION ?= 7.2
export ROOT_DIR=${PWD}
#
### DOCKER
# --------
#
.PHONY: dev
docker.dev: ## Prepare the env file before running docker
cp .env.dist .env
.PHONY: build
docker.build: ## Build the PHP docker image
docker-compose build php${PHP_VERSION}
.PHONY: install-deps
docker.deps: ## Install dependencies
docker/run-task php${PHP_VERSION} composer install
.PHONY: install-all-deps
docker.all-deps: docker.deps ## Install dependencies
docker/run-task php${PHP_VERSION} composer require --no-update \
aws/aws-sdk-php:^3.158 \
google/apiclient:^2.12 \
doctrine/dbal:^3.4 \
league/flysystem:^1.0 \
microsoft/azure-storage-blob:^1.0 \
phpseclib/phpseclib:^2.0 \
mongodb/mongodb:^1.1 \
async-aws/simple-s3:^0.1.1
.PHONY: tests
docker.tests: ## Run tests
docker/run-task php${PHP_VERSION} bin/tests
.PHONY: php-cs-compare
docker.php-cs-compare: ## Run CS fixer (dry run)
docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix \
--diff \
--dry-run \
--show-progress=none \
--verbose
.PHONY: php-cs-fix
docker.php-cs-fix: ## Run CS fixer
docker/run-task php${PHP_VERSION} vendor/bin/php-cs-fixer fix
#
### LOCAL TASKS
# -------
#
remove-phpspec: ## Remove adapter specs (allows you to run test suite without adapters that needs deps)
rm spec/Gaufrette/Adapter/AsyncAwsS3Spec.php
rm spec/Gaufrette/Adapter/AwsS3Spec.php
rm spec/Gaufrette/Adapter/AzureBlobStorageSpec.php
rm -r spec/Gaufrette/Adapter/AzureBlobStorage
rm spec/Gaufrette/Adapter/DoctrineDbalSpec.php
rm spec/Gaufrette/Adapter/FlysystemSpec.php
rm spec/Gaufrette/Adapter/GoogleCloudStorageSpec.php
rm spec/Gaufrette/Adapter/GridFSSpec.php
rm spec/Gaufrette/Adapter/PhpseclibSftpSpec.php
require-all-legacy: # kept for compatibility with the old CI config, to be removed at some point
composer require --no-update \
aws/aws-sdk-php:^3.158 \
google/apiclient:^2.12 \
doctrine/dbal:^3.4 \
league/flysystem:^1.0 \
microsoft/azure-storage-blob:^1.0 \
phpseclib/phpseclib:^2.0 \
mongodb/mongodb:^1.1
require-all: require-all-legacy ## Install all dependencies for adapters
composer require --no-update async-aws/simple-s3:^1.0
.PHONY: bc-check
bc-check: ## Check for backward compatibility change
docker run -v ${ROOT_DIR}:/app --rm nyholm/roave-bc-check
.PHONY: clear
clear: ## Remove not versioned files
rm -rf vendor/ composer.lock
test.phpstan: ## Run phpstan analysis
php vendor/bin/phpstan analyze --memory-limit 1G
#
### OTHERS
# --------
#
help: SHELL=/bin/bash
help: ## Dislay this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?## .*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\n\033[33m%s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'; fi; \
done; unset IFS;
@echo ""
@echo "Hint: use 'make command PHP_VERSION=X.X' to specify the PHP version with docker commands."
.PHONY: help