Adding Proto folder to opentelemetry-php (#214)

* Adding Proto to opentelemetry-php
Signed-off-by:Ritick Gautam <riticksinghrajput@gmail.com>

* Updated the script for generating proto folder in root

* Moved shell file in script folder
updated .gitignore

* Removed opentelemetry-proto

* Bug fixed

* added docker-compose.proto.yaml
updated script file
updated Makefile

* Update docker-compose.proto.yaml

* Updated README.md
This commit is contained in:
Ritick Gautam 2020-11-18 19:54:42 +05:30 committed by GitHub
parent f0bf8e15e1
commit ed07a9e13b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ vendor
coverage.clover
tests/coverage
.php_cs.cache
proto/*

View File

@ -24,6 +24,8 @@ metrics-prometheus-example:
@docker-compose -f docker-compose.prometheus.yaml run php-prometheus php /var/www/public/examples/prometheus/PrometheusMetricsExample.php
stop-prometheus:
@docker-compose -f docker-compose.prometheus.yaml stop
proto:
@docker-compose -f docker-compose.proto.yaml up proto
bash:
$(DC_RUN_PHP) bash
style:

View File

@ -42,6 +42,13 @@ We use docker and docker-compose to perform a lot of our static analysis and tes
If you're planning to develop for this library, it'll help to install `docker engine` and `docker-compose`.
You can find installation instructions for these packages can be found [here](https://docs.docker.com/install/), under the `Docker Engine` and `Docker Compose` submenus respectively.
##Proto Generation
In order to generate proto files for use with this repository, we can perform a
`make proto`
From the root directory. This wil create a `/proto` folder in the root directory of the repository.
## Styling
We use [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) for our code linting and standards fixer. The associated configuration for this standards fixer can be found in the root of the repository [here](https://github.com/open-telemetry/opentelemetry-php/blob/master/.php_cs)

View File

@ -0,0 +1,7 @@
version: '3.7'
services:
proto:
image: socialpoint/protobuf-tools
volumes:
- ./:/mnt
command: sh -c "/mnt/script/proto_gen.sh"

6
script/proto_gen.sh Executable file
View File

@ -0,0 +1,6 @@
apk update && apk add git
mkdir /mnt/proto
git clone https://github.com/open-telemetry/opentelemetry-proto
protoc --proto_path=opentelemetry-proto/ --php_out=/mnt/proto --grpc_out=/mnt/proto --plugin=protoc-gen-grpc=usr/local/bin/grpc_php_plugin $(find opentelemetry-proto/opentelemetry -iname "*.proto")