Skip to content

Setup: Dev

Angel Rey edited this page Dec 23, 2020 · 1 revision

ODDSLINGERS_ENV=DEV

Intro

There are different ways to run the dev environment:

  1. Run the docker-compose file
  2. Run the automated setup script
  3. Manually install and setup everything
  4. Run the ansible playbook

Each has its tradeoffs, but generally manually installing is recommended so you know how everything works.

First, read the Layers of the Stack, Configuration, and Folder Locations pages to get a feel for how the project is laid out.

Run docker-compose file

First, read a little about how to install docker and docker compose for your specific OS.

Later, you can follow the next steps for running oddslingers by docker-compose:

git clone https://github.com/Monadical-SAS/oddslingers.poker.git
cd oddslingers.poker

# Add to /etc/hosts  ->   127.0.0.1    oddslingers.l 

docker-compose run django ./manage.py migrate
docker-compose run django ./manage.py createsuperuser
docker-compose up

# Open http://oddslingers.l

From here, you could begin to do changes in the codebase and to run these commands for developing tasks:

# For installing yarn packages
docker-compose run --rm django oddslingers yarn_install

# For testing
docker-compose run --rm django oddslingers testpy
docker-compose run --rm django oddslingers testjs

# For linting
docker-compose run --rm django oddslingers lintpy
docker-compose run --rm django oddslingers lintjs

# For rebuilding docker images and update the python packages
docker-compose build

Some useful docker-compose commands:

# Start the stack
docker-compose start

# Stop the stack
docker-compose stop

# List the services
docker-compose ps

# Init the stack
docker-compose up

# Destroy the stack (This delete the docker containers)
docker-compose down

You can get more information about docker-compose running in Docker Compose page.

Automated Setup Script

Follow the README.md quickstart instructions and run the one for your system:

Manual Setup

Manual setup is usually a good way to understand which are the different technologies oddslingers use. It is recommended for devops and sysadmins. You can follow the steps described in the Manual setup page.

Ansible playbook

Ansible is a technology used to install software and to aprovisionate servers in a easy way. It is a good method for understading the steps to install oddslingers in a higher level than a bash script. And it is useful for remote installations. Check the steps to install oddslingers by using an ansible playbook in the Ansible setup page.