Skip to content

ShatteredRealms/character-service

Repository files navigation

Overview Unit and Integration Tests Build Image codecov

Development

Requirements

Required:

  • Golang ~> 1.23 Preferred:
  • Make
  • Docker

Getting Started

The following commands download all dependencies and installs any required tools for development.

go mod download
make build-tools

Anytime changes to the gRPC API are made, the following command should be run to generate protobuf files and update the mocks used for testing.

make protos

Migrations

Any changes to the underlying database schema should be reflected with a migration file in the migrations folder. The following command will generate a new migration file.

migrate create -ext sql -dir migrations

Migrations are auto applied on startup when using a pgx repository.

Building

The application version is automatically taken as the latest version tag. Binary: make build the output result will be placed in the bin folder in the project root directory.\ Docker: \

  • make docker builds a docker image called sro-<app-name> with 3 tags variants latest, ${version}, and ${version}-${commit hash}.
  • make push push the image to the docker repository.
  • make docker push runs docker then push.

Note: A helper command make aws-docker-login is available to authenticate with the default aws credential context if pushing to AWS ECR.

Testing

  • make test runs all tests and builds a coverage report
  • make report views the coverage report in the browser
  • make test-watch runs the tests with coverage on all .go file changes.
  • make report-watch updates coverage results as they update.
  • make dev-watch -j simply runs both test-watch and report-watch in parallel.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages