-
-
Notifications
You must be signed in to change notification settings - Fork 253
/
Makefile
61 lines (53 loc) · 1.53 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
PHP_DOCKER_VERSION := thecodingmachine/php:8.3-v4-cli
PHP_BIN := docker run -it --rm \
--network=ddeboer_imap_network \
--env IMAP_SERVER_NAME=ddeboer_imap_server \
--env IMAP_SERVER_PORT=993 \
--env [email protected] \
--env IMAP_PASSWORD=p4ssword \
--env PHP_EXTENSION_IMAP=1 \
--env PHP_EXTENSION_PCOV=1 \
-v "$(PWD)":"$(PWD)" -w "$(PWD)" \
$(PHP_DOCKER_VERSION)
all: csfix static-analysis test
@echo "Done."
vendor: composer.json
$(PHP_BIN) composer update
$(PHP_BIN) composer bump
touch vendor
.PHONY: csfix
csfix: vendor
$(PHP_BIN) vendor/bin/php-cs-fixer fix --verbose
.PHONY: static-analysis
static-analysis: vendor
$(PHP_BIN) vendor/bin/phpstan analyse $(PHPSTAN_FLAGS)
wait-for-it:
wget -O wait-for-it "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh"
chmod +x wait-for-it
.PHONY: start-imap-server
start-imap-server: wait-for-it
docker pull $(PHP_DOCKER_VERSION)
docker pull antespi/docker-imap-devel:latest
docker network create ddeboer_imap_network
docker run \
--name=ddeboer_imap_server \
--network=ddeboer_imap_network \
--detach \
--rm \
--expose 993 \
--publish 10993:993 \
--env MAILNAME=test.test \
--env [email protected] \
--env MAIL_PASS=p4ssword \
antespi/docker-imap-devel:latest
./wait-for-it localhost:10993
.PHONY: stop-imap-server
stop-imap-server:
docker stop ddeboer_imap_server
docker network rm ddeboer_imap_network
.PHONY: test
test: vendor
$(PHP_BIN) php \
-d zend.assertions=1 \
vendor/bin/phpunit \
$(PHPUNIT_FLAGS)