Skip to content

phuang26/suprabank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SupraBank

A repository for intermolecular interactions - http://suprabank.org

CircleCI

Codacy Badge

Offical Docker Image: https://hub.docker.com/r/stephansinn/suprabank.org


Local Development

Prerequisites

Get Started

You might need sudo rights.

Starting

Clone the repository from the development branch

git clone https://github.com/StephanSinn/suprabank.git
cp ./.env.example ./.env

No local postgresql server should be running

service postgresql stop

It might be necessary to increase the HTTP timeout

export COMPOSE_HTTP_TIMEOUT=240

Start the container

docker-compose up -d

If there are problems with gems, first stop the container with

docker-compose down

and then uncomment the following two lines in docker_entrypoint.sh

bundle update
bundle install --path vendor/bundle

and start the container again

docker-compose up -d

Accessing the Container

docker-compose exec web bash

Running Tests

docker-compose exec web bash

In the docker bash:

rake test

If this fails, try:

bundle exec rake test

Shutting Down

docker-compose down

If this fails, call first

sudo aa-remove-unknown

and then try again.

Build Docker Image

build the docker image locally using the following command:

docker build -t stephansinn/suprabank.org .

to launch the local development environment run

docker-compose up -d

Working

The database will be empty, does you need some data to work with.

docker-compose exec web bash

In the docker bash:

rake db:seed
rake interactor:runall

If this fails, try:

bundle exec rake db:seed
bundle exec rake interactor:runall

These two comments will feed the Technique and AssayType arrays as well as generate some Users, Molecules and Interactions to work with. All defined in lib/tasks/interactor.rake If you want to have an user with admin rights, you need to change the role of one of the users: Open the rails console in the docker bash:

rails c

and then e.g.:

user = User.find_by(email:"user1@gmail.com")
user.admin!

Interactive Debugging

We use the byebug gem for debugging, it is already available in test and development environment. docker-compose up does not support interactive debugging. docker/compose#4677

stop the running containers and start two instances via run to have the server

docker-compose down
docker-compose run --service-ports web

and the bash.

docker-compose run web bash

Learn More

Tutorial we followed to create the series of commands / steps listed below: https://thoughtbot.com/blog/rails-on-docker


Branching

We follow the "Github Flow" branching strategy. If you want to learn more: https://guides.github.com/introduction/flow/

  1. checkout development
  2. create feature branch
  3. commit
  4. push
  5. open pull request to development

About

suprabank

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published