- Install a ruby version between 2.5 and 3.
bundle install
- Install postgres, if you haven't already, and create yourself a database.
- Create a config.yml file in the app root dir. You need a
db
key with the following subkeys:db_name
db_address
db_username
db_password
- Run the migrations:
rake db:migrate
- Add the tournaments.
download_tournament_entries.rb
has the list of tournament keys. - Add the GFYs to the DB as below.
- If you have any questions, open a ticket or email me.
- Add the new tournament to the database.
- Download the entries via
ruby download_tournament_entries.rb
- Run
ruby ./update_gfycat_list.rb
. 3. Locally, just run the script and it'll use whatever is in yourconfig.yml
4. to update heroku, prepend it with DATABASE_URL=heroku config:get DATABASE_URL -a fencing-db
- run the rake tasks
db:normalize_names
anddb:add_bouts
.
This section is also a rake task named db:update_gfycats
but that probably won't work on heroku.
- dump the db by running
pg_dump -c --no-owner fencingstats > dump.dump
- upload it to heroku by running
heroku pg:psql < dump.dump
- Create a backup:
heroku pg:backups:capture
- Download the backup:
heroku pg:backups:download
- load the data in the the local database:
pg_restore --verbose --clean --no-acl --no-owner -d fencingstats latest.dump
- Find the tournament on the fie page, click "entries".
- add the entries page(s) to the hash in
download_tournament_entries.rb'.
- locally:
ruby download_tournament_entries.rb
- on heroku: DATABASE_URL=
heroku config:get DATABASE_URL -a fencing-db
rubydownload_tournament_entries.rb