/chess-ranking

Primary LanguageRubyMIT LicenseMIT

Chess Ranking Web Site

See

Chess Ranking

Prepare

  • csv file for ranking. get from ncs web page

Get Started

  • docker-compose build
  • docker-compose run web rails db:seed
  • docker-compose up
  • open http://localhost:3064/players

In Production

  • copy config/master.key (this file is ignored from git)
    • or you can recreate credentials.yml.enc and master.key:
      • rm credentials.yml.enc
      • docker-compose run -e EDITOR=vim web rails credentials:edit
        • you need to set Rails.application.credentials variables
  • docker-compose -f docker-compose.production.yml build
  • docker-compose -f docker-compose.production.yml run web rails db:migrate:reset RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1
  • docker-compose -f docker-compose.production.yml up -d

Update DB

  • get a new excel file from NCS and export as csv file
  • put the csv file to lib/assets
  • docker-compose run web rails db:seed

Development

  • generate Home controller docker-compose run web rails g controller Users

after you change something

  • docker-compose run web bundle install
  • docker-compose up --build

before Pull Request

  • docker-compose run web rubocop -A
  • docker-compose run web rails test

sitemap

We use sitemap_generator.

Generate public/sitemap.xml.gz file by rake sitemap:refresh.

This file is ignored by git.

pry

  1. set binding.pry
  2. check container id: docker ps
  3. docker attach container_id
  4. open browser
  5. exit
  6. Ctrl + q

connect to the local DB

psql --host=localhost --port=5464 --username=postgres --password --dbname=chess_ranking_development