Important Scripts in our system
At opentrack a large amount of scripts already exist, this document was made to have a nice page to manage them/remember them so that none get lost
Generally Useful Scripts
/federation/:
- ./bin/aws-copy-db-to-test - Copy database from live directly to the test server
- ./bin/aws-copy-db-to-s3 - Copy database from live to the aws s3 repo that you can copy data down from
- ./update-dev-environment - Copy database from aws s3 repo to your local copy
- update_fed_role_end_date.py - !!Old script, would be worth double checking it's still valid!! This script seems to update the registered roles for all athletes of a fed organisation who need it
- cyprus_get.py - Provides useful clone information for cyprus, including a generic method uding "SOUNDS like" for names.
- personextra_mass_calculate.py - Fine to rerun. Should always fix incorrect data. Useful if you add a new calc_####### field you need to resync on live or test
Below is the set of manual scripts
Manual monthly Import script files
SA spreadsheet uses the password: Otd20
Scotland:
- project/federation/management/commands/import_scottish_athletes.py
Northern Ireland:
- project/federation/management/commands/import_northern_ireland_athletes.py
process:
-
convert the spreadsheet to a csv and save it in project/federation/fixtures/
and follow the pattern of previous uploads to name it. -
adjust the following line to use the file path of the new csv you saved in (1):
with open("project/federation/fixtures/scotland/athletes_{year}{month}.csv") as csv_file: -
Run the file. If all runs well you should see no errors
possible occurances: If there is no warning, you may still see some club names under "Not found clubs", these will likely already be in our system, if so you need to create a mapping to it's name in our system using the mapped_club_names list. If it's not in our system give Gus the list and he will let you know if they need to be created or not.
Below is the set of automatic scripts that run
Monthly-run script files
...
Weekly-run script files
/federation/:
- generate_wa_dashboard.py - Generates a new downloadable spreadsheet for the wales dashboard
Daily-run script files
One of the ways in which we run these daily tasks can be setup with aws and checked using https://docs.apppack.io/command-line-reference/apppack_scheduled-tasks/
One of these tasks is the file:
./bin/aws-daily
Contains a list of daily commands that get run including export_european_calendar.py
This is a big one because it contains a lot of our daily stuff including:
- s3_temp_reports_delete
- update_dashboards
- calc_revevnues
- export_european_calendar --all
- notify_statisticians
- clearsessions
- notify_renewals --country=EST
- notify_renewals --country=MLT
/euroath/:
- export_european_calendar.py - Used to export a set of competitions which are used here: https://www.european-athletics.com/calendar
/federation/:
- import_serbia.py
- notify_ireland.py - Notify Entry4Sports of any pending renewals
/main/:
- set_marketing_preferences.py - Creates user profiles and updates competition interests.
/payments/:
- process_late_payments.py - Used to handle late payments, whether its competition based, a membership payment or otherwise
- fetch_stripe_pi.py - Fetch json of payment and update success