59 lines
2.8 KiB
Markdown
59 lines
2.8 KiB
Markdown
# turniere-backend
|
|
[](https://travis-ci.org/turniere/turniere-backend) [](https://gitlab.com/turniere/turniere-backend/commits/master) [](https://coveralls.io/gitlab/turniere/turniere-backend?branch=master) [](https://houndci.com) [](https://app.codacy.com/app/Malaber/turniere-backend) [](https://sonarcloud.io/dashboard?id=turniere_turniere-backend) [](https://codeclimate.com/github/turniere/turniere-backend/maintainability)
|
|
|
|
Ruby on Rails application serving as backend for turnie.re
|
|
|
|
## Quick install with Docker
|
|
[turnie.re - Quickstart](https://github.com/turniere/turniere-quickstart)
|
|
|
|
## Installation
|
|
```bash
|
|
# install dependencies
|
|
$ bundle config set with "development test"
|
|
$ bundle install
|
|
# run migrations
|
|
$ rails db:migrate
|
|
```
|
|
|
|
## Running
|
|
Development (without mail confirmation and separate database):
|
|
```bash
|
|
$ RAILS_ENV=development rails server
|
|
```
|
|
|
|
## Testing
|
|
Running tests works as follows:
|
|
```bash
|
|
bundle exec rspec
|
|
```
|
|
|
|
Leader/follower tournament sync docs:
|
|
|
|
- [doc/leader_follower.md](doc/leader_follower.md)
|
|
- [doc/timer_api.md](doc/timer_api.md)
|
|
|
|
## Docker
|
|
[Registry](https://gitlab.com/turniere/turniere-backend/container_registry)
|
|
|
|
You can find all our Dockerfiles in the docker directory.
|
|
They depend on each other in the following order: `production` → `test`
|
|
This means, to build `test` image, you have to build `production` image first and tag it with corresponding tag that is mentioned in `FROM` line in `test` Dockerfile.
|
|
To build all images do:
|
|
|
|
```bash
|
|
cd turniere-backend
|
|
docker build -t registry.gitlab.com/turniere/turniere-backend/production -f docker/production/Dockerfile .
|
|
docker build -t registry.gitlab.com/turniere/turniere-backend/test -f docker/test/Dockerfile .
|
|
```
|
|
|
|
This is done to leave test and development dependencies out of production container.
|
|
Also we have dedicated test container which runs tests reproducible when you start it, but can also run normal rails server to debug problems occuring in test suite if needed.
|
|
|
|
While developing, use `test` image as base container and mount root of this repository into `/app` to avoid rebuilding it over and over again.
|
|
|
|
|
|
## Generate diagrams
|
|
```bash
|
|
$ rails diagram:all_with_engines
|
|
```
|