-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
88 lines (72 loc) · 3.33 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
.PHONY: all unit-test integration-test security-test
.PHONY: install-deps install-composer install-protobuf help
.PHONY: protogen release
export PB_INTERFACE = 1
PROTOC := ./vendor/bin/protoc
PHP_VERSION := $(shell php -r 'echo "php-";echo phpversion();')
all: test
test: unit-test integration-test scenario-test
unit-test:
@php ./vendor/bin/phpunit --testsuite=unit-tests
integration-test:
@php ./vendor/bin/phpunit --testsuite=functional-tests
scenario-test:
@php ./vendor/bin/phpunit --testsuite=scenario-tests
security-test:
@php ./vendor/bin/phpunit --testsuite=security-tests
install-deps: install-composer
@./composer install
timeseries-test:
@php ./vendor/bin/phpunit vendor/basho/riak/tests/functional/TimeSeriesOperationsTest.php
install-composer: composer
install-protobuf: install-deps
cd vendor/basho/protobuf && \
phpize && \
./configure && \
$(MAKE) && \
$(MAKE) install && \
php -r "echo PHP_EOL;" && \
php -r "echo 'IMPORTANT!';echo PHP_EOL;" && \
php -r "echo 'Please enable protobuf.so in php.ini (location: \"' . php_ini_loaded_file() . '\")'; echo PHP_EOL;"
composer:
@rm -f ./composer.phar ./composer
@php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
@php ./composer-setup.php --filename=composer
@rm -f ./composer-setup.php
protogen:
mkdir -p src/Basho
mv -f src/Riak src/Basho/Riak
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak_dt.proto
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak_kv.proto
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak.proto
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak_search.proto
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak_ts.proto
$(PROTOC) --package='Basho\Riak\Api\Pb\Message' --use-namespaces --psr --destination='src/' riak_pb/src/riak_yokozuna.proto
mv -f src/Basho/Riak src/Riak
rm -rf src/Basho
rm -f pb_proto_riak.php
release:
ifeq ($(VERSION),)
$(error VERSION must be set to deploy this code)
endif
ifeq ($(RELEASE_GPG_KEYNAME),)
$(error RELEASE_GPG_KEYNAME must be set to deploy this code)
endif
@./tools/build/publish $(VERSION) master validate
@git tag --sign -a "$(VERSION)" -m "riak-phppb-client $(VERSION)" --local-user "$(RELEASE_GPG_KEYNAME)"
@git push --tags
@./tools/build/publish $(VERSION) master 'Riak PHP PB Client' 'riak-phppb-client'
help:
@echo ''
@echo ' Targets:'
@echo '-----------------------------------------------------------------'
@echo ' all - Run all tests '
@echo ' install-deps - Install required dependencies '
@echo ' install-composer - Installs composer '
@echo ' install-protobuf - Installs protobuf dependency '
@echo ' test - Run unit & integration tests '
@echo ' unit-test - Run unit tests '
@echo ' integration-test - Run integration tests '
@echo ' security-test - Run security tests '
@echo '-----------------------------------------------------------------'
@echo ''