Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 2.32 KB

README.md

File metadata and controls

69 lines (45 loc) · 2.32 KB

Lama - Account Manager

Getting started

  1. Install sbt
  2. Install PostgreSQL and configure access for user lama and password serge (default user and password from src/main/resources/application.conf)
  3. Create database lama and give access to the configured user
  4. Apply migration (see Database migration)
  5. Install RabbitMQ and configure access for user lama and password serge (default user and password from src/main/resources/application.conf)
  6. Install Redis with the default configuration

Run the account manager

A shared build.sbt file is used at the root of the lama project to share common libraries and handle multiple sub projects.

All following sbt commands should be done at the root path of the lama project.

Run the app: sbt accountManager/run

Database migration

The project uses flywayt-sbt to migrate sql scripts in the folder src/main/resources/db/migration.

Migrate your database using sbt accountManager/flywayMigrate or clean it using sbt accountManager/flywayClean.

Testing

Unit tests

sbt accountManager/test

Integration tests

  • Create the test-lama database

psql -h localhost -p 15432 -U lama -c "CREATE DATABASE test-lama"

  • Run tests

sbt accountManager/it:test

Docker

The plugin sbt-docker is used to build, run and publish the docker image.

The plugin provides these useful commands:

  • sbt accountManager/docker: Builds an image.

  • sbt accountManager/docker:stage: Generates a directory with the Dockerfile and environment prepared for creating a Docker image.

  • sbt accountManager/docker:publishLocal: Builds an image using the local Docker server.

  • sbt accountManager/docker:publish Builds an image using the local Docker server, and pushes it to the configured remote repository.

  • sbt accountManager/docker:clean Removes the built image from the local Docker server.