summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/scripts.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/scripts.md b/docs/scripts.md
index d715671..fbec3f2 100644
--- a/docs/scripts.md
+++ b/docs/scripts.md
@@ -7,14 +7,20 @@ Contents of this repository is grouped in several directories, the most signific
MySQL configuration for the tools. Both files are encrypted in this repository, but they follow the format as defined in `docs/db-example.json`. `db.json` is used by tools that fetch data from the database, `import-db.json` is used by tools that write data into the database - so you can have some granularity in RDBMS permissions.
+---
+
`static.json`
List of pages linked in the top page menu. It's also used to define the list of auto-generated static pages - each entry's `content` property can define content file from `static` directory, in which case the page is being generated via `make statics`.
+---
+
`dates.json`
Defines ranking editions and their basic properties. Every script which iterates over ranking editions, reads this config file.
+---
+
`deploy-path`, `deploy-pass`
Configuration for `deploy.sh` script (invoked via `make deploy`). Files define parameters that are directly compiled into `rsync` invokation and are encrypted in this repository.
@@ -29,14 +35,20 @@ Data import operations
Downloads and sanitizes MSC Cezar players file in CSV format (`baza.csv`). Data file is always put in `data/cezar` directory, regardless of current working directory, and its name is the previous day's date.
+---
+
`cezar-db-import.sh`
Loads the downloaded MSC Cezar players CSV file into `players` table, as is. Existing rows (identified by player ID) are replaced, old rows (i.e. ones that are not in the CSV file) are not removed.
+---
+
`rankings-csv-import.sh`
Loads the prepared ranking data CSV file (as processed by `scripts/rankings-csv-convert.py`) into the database. CSV file is first loaded as in into intermediate table, and then joined with *current* player data and processed into `rankings` table.
+---
+
The above scripts can be used to prepare the database for generating ranking pages with any meaningful data. Data import is not covered by any `Makefile` targets, so you need to prepare the database manually (or via these scripts).
For PBU data included in the repository, you'd have to run:
@@ -62,6 +74,8 @@ Data export tools
Generates JSON data files used by ranking table pages. Takes `config/dates.json` file location and desired output directory as parameters and produces files named by ranking editions dates.
+---
+
`group-tools-json.sh`
Generates JSON data file used by special static page for estimated cumulative ranking for groups of players. Takes the `config/dates.json` file location and output directory **of the special group-tools static page** as parameters. The latest (chronologically) edition of the ranking is always taken as data source.
@@ -73,6 +87,8 @@ Static content generating scripts
Takes two parameters: `config/static.json` file location and output directory. The output directory is then scanned for subdirectories (these beginning with an underscore are ignored) and in each of these subdirectories, script writes a `.menu.html` file, containing HTML snippet with static pages menu, with links adjusted as relative to the output directory.
+---
+
`statics-generate.sh`
Generates all the static pages with defined content from `config/static.json` (which is the script's first parameter). Content source files are resolved relative to script's second parameter, the third being output directory for the pages.
@@ -84,6 +100,8 @@ Ranking pages generating scripts
Helper script which takes `config/dates.json` and produces target files for ranking pages for `Makefile` purposes (each ranking table file gets its own target via `Makefile` expansion).
+---
+
`rankings-tables-build.sh`
Iterates through ranking editions from `config/dates.json` (script's first parameter) and generates corresponding ranking pages in output directory (second parameter).