Makefile command reference

Every target in the repo root Makefile. All targets operate on the stock dbt project (src/stock/dbt) unless named *-redbook*.

Setup & testing

CommandDoes
make test-setupFirst-time setup: creates the stock venv, installs dbt-core/dbt-snowflake, writes DRIVE_STAGING_DBT_KEY_PATH into the venv activation script, runs dbt deps.
make testRuns dbt unit tests (dbt test --select "test_type:unit" --target staging). Daily-use command.
make test-file FILE=<name>Runs unit tests for one file, e.g. make test-file FILE=test_stock_warranty_ref.yml. Fails with a usage message if FILE is omitted.
make test-fixturesRuns fixture-based stored-procedure tests (tests/fixtures/run-fixture-tests.sh).
make test-alltest + test-fixtures.
make cleanDeletes the stock project's venv, target, dbt_packages, logs.

dbt runs — staging

CommandDoes
make dbt-run-stockdbt run --target staging for stock.
make dbt-run-redbookSame, for redbook.
make dbt-full-refresh-stockdbt build --target staging --full-refresh for stock. Resets deactivated_at/is_sold — the Makefile's own comment flags this as destructive.
make dbt-full-refresh-redbookFull refresh for redbook.

dbt runs — production

CommandDoes
make dbt-run-stock-proddbt run --target prod for stock.
make dbt-run-redbook-prodSame, for redbook.
make dbt-full-refresh-stock-prodFull refresh, prod — same deactivated_at/is_sold reset warning applies.
make dbt-full-refresh-redbook-prodFull refresh for redbook, prod.

Migrations

CommandDoes
make deploy-migrations-stockDeploys stock migrations to staging via deploy-migrations.sh.
make deploy-migrations-redbookSame, for redbook — currently fails; see note below.
make deploy-migrations-stock-prodDeploys stock migrations to production.
make deploy-migrations-redbook-prodDeploys redbook migrations to production — currently fails; see note below.

All four are interactive (dry-run, then a y/N prompt) — see Deploying migrations locally for the non-interactive form.

The redbook targets cd into src/redbook/dbt, but redbook's deploy-migrations.sh requires running from inside migrations/ itself — see Deploying migrations locally for the working invocation.

See also

Esc