forked from petert82/monolog-logfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (61 loc) · 1.75 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
.PHONY: all bash-php7 bash-php8 build composer-install composer-update test-php
all: build test-php
bash-php7:
@docker run \
--name=monolog-logfmt-php7 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
-it \
--rm \
monolog-logfmt-php7 \
sh -c "bash"
bash-php8:
@docker run \
--name=monolog-logfmt-php7 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
-it \
--rm \
monolog-logfmt-php7 \
sh -c "bash"
build:
@echo "Building PHP 7 image"
@docker build -t monolog-logfmt-php7 -f docker/php7/Dockerfile .
@echo "Building PHP 8 image"
@docker build -t monolog-logfmt-php8 -f docker/php8/Dockerfile .
composer-install:
@echo "Running composer install (PHP 7)"
@docker run \
--name=monolog-logfmt-php7 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
--rm \
monolog-logfmt-php7 \
sh -c "composer install"
@echo "Running composer install (PHP 8)"
@docker run \
--name=monolog-logfmt-php8 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
--rm \
monolog-logfmt-php8 \
sh -c "composer install"
composer-update:
@echo "Running composer update (PHP 7)"
@docker run \
--name=monolog-logfmt-php7 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
--rm \
monolog-logfmt-php7 \
sh -c "composer update"
test-php:
@echo "Running tests (PHP 7)"
@docker run \
--name=monolog-logfmt-php7 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
--rm \
monolog-logfmt-php7 \
sh -c "composer install && vendor/bin/phpunit"
@echo "Running tests (PHP 8)"
@docker run \
--name=monolog-logfmt-php8 \
--mount type=bind,source="$$(pwd)",target=/usr/src/monolog-logfmt \
--rm \
monolog-logfmt-php8 \
sh -c "composer install && vendor/bin/phpunit"