Hanami / Twirp fusion. This service does... what?
This service makes heavy use of docker and docker compose. Setting up docker is beyond the scope of this readme.
mkdir ~/projects/my_project/
cd ~/projects/my_project/
git clone [email protected]:my_project/my_service.git
git clone [email protected]:my_project/protos.git
cd ~/projects/my_project/my_service
docker-compose run --rm bundle install --with development test
docker-compose up -d
docker-compose run --rm bundle exec hanami db prepare
docker-compose run --rm bundle exec rake seed:things
docker-compose run --rm bundle exec rake twirp:fetch_thing
Generate code when you change applicable .proto
files:
# This expects your proto files to be in the same directory as your app
docker-compose run --rm protoc
How to run various Hanami commands:
docker-compose run --rm bundle exec hanami console
docker-compose run --rm bundle exec hanami g model NewModel
How to prepare (create and migrate) DB for development
and test
environments:
docker-compose run -e HANAMI_ENV=test --rm bundle exec hanami db prepare
docker-compose run --rm rpsec
This should be done for you via CI/CD, but in case you need to manually push an image:
docker login https://docker.pkg.github.com
docker build -t docker.pkg.github.com/my_project/my_service/my_service:0.1.0 .
docker push docker.pkg.github.com/my_project/my_service/my_service:0.1.0
Explore Hanami guides, API docs, or jump in chat for help. Enjoy! 🌸
Learn about Twirp.
Learn about protobuf.
Learn about Docker.
Learn about GitHub Actions.