These scripts are provided for development of clairBuoyant. The script names are standardized across all repositories for clairBuoyant to simplify the development experience.
π scripts/
βββ π db/
β βββ π create
β βββ π docker
β βββ π migrations_autogenerate
β βββ π migrations_run
β βββ π seeds
βββ π bootstrap
βββ π check
βββ π clean
βββ π coverage
βββ π dotenv
βββ π init
βββ π lint
βββ π setup
βββ π start
βββ π test
βββ π uninstall
The command to run can be inferred based on the following pattern:
- command:
filename- e.g.,
bootstrap- filename: bootstrap
- subFolderName: n/a
- e.g.,
- command:
subFolderName-filename- e.g.,
db-migrations_autogenerate- filename: migrations_autogenerate
- subFolderName: db
- e.g.,
See below for list of available commands.
-
db-create: create databases locally. [π§ currently unsupported π§] -
db-docker: create databases in docker. -
db-migrations_autogenerate: autogenerate migration files for db schema changes.# recommended: provide revision message between double quotes poetry run db-migrations_autogenerate "<optional-descriptive-comment>" # without providing revision message poetry run db-migrations_autogenerate
-
db-migrations_run: apply database schema changes from migration files.# DEFAULT: apply all latest migration changes poetry run db-migrations_run # apply number of migrations relative to current version # <integer> cannot be greater than number of migration files poetry run db-migrations_run <integer> # apply migrations until specified revision version poetry run db-migrations_run <partial-or-full-revision-version>
-
db-migrations_undo: undo database schema changes from migration files.# DEFAULT: undo latest migration poetry run db-migrations_undo # undo all migrations poetry run db-migrations_undo base # undo number of migrations relative to current version # <integer> cannot be greater than number of migration files poetry run db-migrations_undo <integer> # undo migrations until specified revision version poetry run db-migrations_undo <partial-or-full-revision-version>
-
db-seeds: populate database with initial dataset. -
bootstrap: resolve all system dependencies the application needs to run. -
check: check whether code linting passes. -
clean: remove all unnecessary build artifacts. -
dotenv: create .env file for development. -
coverage: check test coverage. -
init: run bootstrap, setup, and dotenv. -
lint: run code linting. -
setup: install python dependencies and githooks. -
start: start server locally with dotenv. -
test: run test suite. -
uninstall: remove python dependencies and build artifacts.
These scripts can be used directly or with poetry (recommended).
- Run with poetry:
poetry run <command_name>(e.g.,poetry run init) 1 - Run directly:
./scripts/<filename>(e.g.,./scripts/initor./scripts/db/docker)- Run
. ./aliasesin your terminal to run any script just by<command_name>(e.g.,initordb-docker). 2
-
If you've ran
poetry shell(i.e., ifwhich pythonoutputs "path/to/clairBuoyant/server/.venv/bin/python"), you could just run these scripts by<command_name>in terminal (e.g.,initordb-docker). -
Alternatively, you could run
. ./aliases. This will load all command names to current shell, so you can call on these scripts by<command_name>(e.g.,initordb-docker). This script needs to be re-run every time you start a new terminal session. But, it saves you from prependingpoetry runevery time! :)
Styled after GitHub's "Scripts to Rule Them All".