CLI Cortex Framework build and deploy

uv run cortex-build-and-deploy compiles Google Cloud Cortex Framework modules and declarative assertions into a Dataform package and deploys the output to all enabled targets in deployment.targets.

Synopsis

uv run cortex-build-and-deploy [-h] \
    [-c CONFIG_PATH | --config CONFIG_PATH] \
    [--output-dir OUTPUT_DIR] \
    [--enable-apis] [--create-datasets] \
    [--disable-telemetry] [-y | --yes] \
    [--assertions ASSERTIONS_FILE]

Replace the following:

  • CONFIG_PATH: path to your global config.yaml file, for example: config/config.yaml.
  • OUTPUT_DIR: path to the generated build output directory, for example: dist.
  • ASSERTIONS_FILE: path to a standalone Dataform assertions file, for example: assertions.sqlx.

Global flags

The following table describes all flags supported by uv run cortex-build-and-deploy:

Flag Description Default
-h, --help Show the command help message and exit. None
-c, --config CONFIG_PATH Path to the global config.yaml configuration file. config/config.yaml
--output-dir OUTPUT_DIR Path to the build output directory compiled and deployed to enabled targets. Existing contents in this directory are deleted and recreated during the build step. dist
--enable-apis Enable missing required Google Cloud APIs automatically without interactive prompts for build inputs and (when at least one enabled target uses type: dataform) deployment targets. false
--create-datasets Create missing target BigQuery datasets—including data.defaultAssertionDataset (default dataform_assertions)—without interactive prompts when at least one enabled target uses type: dataform. Logs a warning and has no effect when all enabled targets use type: git. false
--disable-telemetry Disable telemetry event logging during execution. For details, see Cortex Framework telemetry. false
-y, --yes Automatically confirm interactive prompts during non-interactive CI/CD runs, such as creating a missing remote Git branch or overwriting and deleting tracked files outside ignorePatterns on type: git targets. false
--assertions ASSERTIONS_FILE Path to a standalone Dataform assertions file (must be a file, copied into <output_dir>/definitions/assertions/assertions.sqlx during build). For declarative YAML assertions and .sql templates, see Configure data quality assertions. None

Examples

Build and deploy compiled artifacts to enabled targets:

export CORTEX_CONFIG_FILE=config/config.yaml

uv run cortex-build-and-deploy --config $CORTEX_CONFIG_FILE

What's next