4.3. Scripts Reference Guide¶
The page provides a reference guide to the top-level scripts for managing Makahiki.
4.3.1. Installation scripts¶
4.3.1.1. initialize_instance¶
- Invocation: scripts/initialize_instance .py -t|–type[=] default|demo|test
- -r|–heroku[=] <heroku_app> -d|–docker
Use this script to create an instance with different types of configuration:
- [default]: includes the basic configuration. The admin needs to create
- the settings for rounds, resources, resource goals, teams and users, prizes, etc. Uses internal authentication.
- [test] : includes all of “default” configuration, with more test users
- and data. Uses CAS authentication.
if -r or –heroku is specified, it will initialize the instance in the specified heroku app.
- Performs the following:
- installation of any modules in requirements.txt
- re-create the database and database user
- Synchronize and migrates the database schemas.
- Collects and copies the static and media files to the specific location.
- Loads the default or test configuration of data.
4.3.1.2. initialize_postgres¶
Invocation: scripts/initialize_postgres.py
Creates makahiki database and user within postgres database. Assumes that the user postgres is trusted and can login without authentication. This is usually the case by default.
4.3.1.3. update_instance¶
Invocation: scripts/update_instance .py -r|–heroku[=] <heroku_app>
Use this script to update an instance:
if -r or –heroku is specified, it will initialize the instance in the specified heroku app.
- Performs the following:
- Updates and/or installation of any modules in requirements.txt
- Synchronize and migrates the database schemas.
- Collects and copies the static and media files to the specific location.
4.3.2. Development scripts¶
4.3.2.1. compile_less¶
Invocation: compile_less.py [-v | –verbose]
Compiles all of the LESS style files into CSS.
Compiles all the themes and individual page style sheets, creating CSS files for each theme containing all necessary definitions.
4.3.2.2. coverage¶
Invocation: scripts/coverage.py
- Runs the tests and computes their coverage. An HTML coverage report is
- generated in htmlcov/.
4.3.2.3. dump_data¶
Invocation: scripts/dump_data.py
Creates a set of json files in the dumped_data directory containing the current state. This state can be loaded into a new instance using load_data.
4.3.2.4. verify¶
Invocation: scripts/verify.py
Runs pep8, pylint, and tests. If all are successful, there is no output and program terminates normally. If any errors, prints output from unsuccessful programs and exits with non-zero error code.