File tree 4 files changed +24
-16
lines changed
4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change
1
+ DOCKER_FRESH ?= false
2
+
1
3
.PHONY : test
2
4
test :
3
5
./vendor/bin/phpunit
@@ -18,3 +20,21 @@ benchmark:
18
20
php benchmark/stream_tmp_produce.php 1000
19
21
@echo " Socket produce 1k:"
20
22
php benchmark/socket_tmp_produce.php 1000
23
+
24
+ .PHONY : docker-test-env
25
+ docker-test-env :
26
+ ifeq ($(DOCKER_FRESH ) ,true)
27
+ docker build --pull --no-cache --tag=php-amqplib-php:latest $(CURDIR)/docker/php
28
+ docker compose build --no-cache --pull
29
+ docker compose up --pull always --detach
30
+ else
31
+ docker build --tag=php-amqplib-php:latest $(CURDIR)/docker/php
32
+ docker compose up --detach
33
+ endif
34
+
35
+ .PHONY : docker-test
36
+ docker-test :
37
+ docker run --env-file $(CURDIR ) /test.env --network php-amqplib_default \
38
+ --volume $(CURDIR ) :/src --workdir /src \
39
+ --user " $$ (id -u):$$ (id -g)" php-amqplib-php:latest \
40
+ /bin/sh -c ' /usr/bin/composer install && ./vendor/bin/phpunit'
Original file line number Diff line number Diff line change @@ -4,21 +4,6 @@ x-networks: &networks
4
4
- ip6net
5
5
6
6
services :
7
- php :
8
- build : ./docker/php
9
- volumes :
10
- - .:/src
11
- working_dir : /src
12
- environment :
13
- - TEST_RABBITMQ_HOST=php-amqplib-rabbitmq
14
- - TOXIPROXY_HOST=php-amqplib-toxiproxy
15
- - TOXIPROXY_AMQP_PORT=5673
16
- depends_on :
17
- - php-amqplib-rabbitmq
18
- - php-amqplib-toxiproxy
19
- entrypoint : ['tail', '-f', '/dev/null']
20
- << : *networks
21
-
22
7
php-amqplib-rabbitmq :
23
8
image :
24
9
rabbitmq:3-management
Original file line number Diff line number Diff line change 1
- FROM php:8 -cli
1
+ FROM php:7.2 -cli
2
2
3
3
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.2.16/install-php-extensions /usr/local/bin/
4
4
COPY --from=composer /usr/bin/composer /usr/bin/composer
Original file line number Diff line number Diff line change
1
+ TEST_RABBITMQ_HOST = php-amqplib-rabbitmq
2
+ TOXIPROXY_HOST = php-amqplib-toxiproxy
3
+ TOXIPROXY_AMQP_PORT = 5673
You can’t perform that action at this time.
0 commit comments