File: Makefile

package info (click to toggle)
php-amqplib 3.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,060 kB
  • sloc: php: 13,145; makefile: 77; sh: 27
file content (51 lines) | stat: -rw-r--r-- 1,545 bytes parent folder | download
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
DOCKER_FRESH ?= false

TOXIPROXY_HOST ?= localhost
TOXIPROXY_AMQP_TARGET ?= php-amqplib-rabbitmq
TOXIPROXY_AMQP_PORT ?= 5673

.PHONY: test
test:
	TOXIPROXY_HOST=$(TOXIPROXY_HOST) \
	TOXIPROXY_AMQP_TARGET=$(TOXIPROXY_AMQP_TARGET) \
	TOXIPROXY_AMQP_PORT=$(TOXIPROXY_AMQP_PORT) \
		$(CURDIR)/vendor/bin/phpunit

.PHONY: docs
docs:
	wget -qN https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.0/phpDocumentor.phar
	rm -rf ./docs/*
	php -d error_reporting=0 ./phpDocumentor.phar run -v --force --defaultpackagename=PhpAmqpLib --title='php-amqplib' -d ./PhpAmqpLib -t ./docs

.PHONY: benchmark
benchmark:
	@echo "Publishing 10k messages with 1KB of content:"
	php benchmark/producer.php 10000
	@echo "Consuming:"
	php benchmark/consumer.php
	@echo "Stream produce 1k:"
	php benchmark/stream_tmp_produce.php 1000
	@echo "Socket produce 1k:"
	php benchmark/socket_tmp_produce.php 1000

.PHONY: docker-test-env
docker-test-env:
ifeq ($(DOCKER_FRESH),true)
	docker build --pull --no-cache --tag=php-amqplib-php:latest $(CURDIR)/docker/php
	docker compose build --no-cache --pull
	docker compose up --pull always --detach
else
	docker build --tag=php-amqplib-php:latest $(CURDIR)/docker/php
	docker compose up --detach
endif

.PHONY: docker-test
docker-test:
	docker run --env-file $(CURDIR)/test.env --network php-amqplib_default \
		--volume $(CURDIR):/src --workdir /src \
		--user "$$(id -u):$$(id -g)" php-amqplib-php:latest \
			/bin/sh -c '/usr/bin/composer install && ./vendor/bin/phpunit'

.PHONY: clean
clean:
	git clean -xffd