项目作者: dudo

项目描述 :
Ruby gRPC template
高级语言: Ruby
项目地址: git://github.com/dudo/ruby_grpc_skeleton.git
创建时间: 2020-04-25T02:06:31Z
项目社区:https://github.com/dudo/ruby_grpc_skeleton

开源协议:

下载


My Service

Hanami / gRPC fusion. This service does… what?

System Architecture

Setup

This service makes heavy use of docker and docker compose. Setting up docker is beyond the scope of this readme.

  1. mkdir ~/projects/my_project/
  2. cd ~/projects/my_project/
  3. git clone git@github.com:my_project/my_service.git
  4. git clone git@github.com:my_project/protos.git
  5. cd ~/projects/my_project/my_service
  6. docker-compose run --rm bundle install --with development test
  7. docker-compose up -d # you might have to kick this a few times...
  8. docker-compose run --rm bundle exec hanami db prepare
  9. docker-compose run --rm bundle exec rake seed:things
  10. docker-compose run --rm bundle exec rake grpc:fetch_thing

Generate code when you change applicable .proto files:

  1. # This expects your proto files to be in the same directory as your app
  2. docker-compose run --rm protoc

How to run various Hanami commands:

  1. docker-compose run --rm bundle exec hanami console
  2. docker-compose run --rm bundle exec hanami g model NewModel

How to prepare (create and migrate) DB for development and test environments:

  1. docker-compose run -e HANAMI_ENV=test --rm bundle exec hanami db prepare
  2. docker-compose run --rm rpsec

Deployment

This should be done for you via CI/CD, but in case you need to manually push an image:

  1. docker login https://docker.pkg.github.com
  2. docker build -t docker.pkg.github.com/my_project/my_service/my_service:0.1.0 .
  3. docker push docker.pkg.github.com/my_project/my_service/my_service:0.1.0

Reading

Explore Hanami guides, API docs, or jump in chat for help. Enjoy! 🌸

Explore gRPC guides, or jump in chat for help.

Learn about protobuf.

Learn about Docker.

Learn about GitHub Actions.