add rust
This commit is contained in:
parent
91df514bd6
commit
536517f343
40
.drone.yml
40
.drone.yml
@ -36,6 +36,46 @@ trigger:
|
|||||||
ref:
|
ref:
|
||||||
- refs/heads/master
|
- refs/heads/master
|
||||||
|
|
||||||
|
image_pull_secrets:
|
||||||
|
- dockerconfigjson
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: generate-rust-grpc
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: clone-external
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- git clone https://${GIT_USER}:${GIT_PASS}@git.itzana.me/StrafesNET/rust-grpc.git
|
||||||
|
environment:
|
||||||
|
GIT_USER:
|
||||||
|
from_secret: GIT_USER
|
||||||
|
GIT_PASS:
|
||||||
|
from_secret: GIT_PASS
|
||||||
|
|
||||||
|
- name: generate
|
||||||
|
image: registry.itzana.me/strafesnet/tools/grpc-rust:latest
|
||||||
|
commands:
|
||||||
|
- scripts/rust-gen.sh
|
||||||
|
|
||||||
|
- name: commit
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- cd rust-grpc
|
||||||
|
- git add *
|
||||||
|
- 'git commit -m "Autogenerated update for ${DRONE_COMMIT_LINK}" || true'
|
||||||
|
- git push https://$GIT_USER:$GIT_PASS@git.itzana.me/StrafesNET/rust-grpc.git --all
|
||||||
|
environment:
|
||||||
|
GIT_USER:
|
||||||
|
from_secret: GIT_USER
|
||||||
|
GIT_PASS:
|
||||||
|
from_secret: GIT_PASS
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
|
||||||
image_pull_secrets:
|
image_pull_secrets:
|
||||||
- dockerconfigjson
|
- dockerconfigjson
|
||||||
---
|
---
|
||||||
|
12
scripts/rust-gen.sh
Normal file
12
scripts/rust-gen.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
for f in *.proto
|
||||||
|
do
|
||||||
|
name=$(basename $f .proto)
|
||||||
|
mkdir -p ./rust-grpc/$name
|
||||||
|
protoc \
|
||||||
|
--prost_out=./rust-grpc/$name \
|
||||||
|
--tonic_out=./rust-grpc/$name \
|
||||||
|
$f
|
||||||
|
#protoc --experimental_allow_proto3_optional --rust_out=./rust-grpc/$name --rust_opt=paths=source_relative --rust-grpc_out=./rust-grpc/$name --rust-grpc_opt=paths=source_relative
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user