Skip to main content
Run a Bolt schedule when a merge request merges. Choose how GitLab starts the run:
  • With the GitLab connection (recommended): Paradime receives the merge event and runs your on-merge schedules. You do not need a pipeline or an API key.
  • From a GitLab pipeline: your .gitlab-ci.yml calls the Bolt API. Use this if you don’t use the GitLab connection.

Run on merge with the GitLab connection

Prerequisites

  1. A production environment in Paradime.
  2. Connect GitLab on gitlab.com or GitLab Self-Managed, and pick your dbt™ project as one of the connection’s projects. Your workspace can keep its deploy key.

Set up the on-merge schedule

  1. In Bolt, create a schedule or open an existing one.
  2. Enter the dbt™ commands to run, for example dbt run --select state:modified.
  3. Set the Git branch to the branch your merge requests target, for example main. The merge request’s target branch must match it exactly.
  4. Set the trigger type to On Merge.
  5. Save the schedule.
When a merge request merges, Paradime runs the schedule on its merge commit, or on the squash commit if you squash. The run uses that commit even if more commits land on the branch while it runs. Paradime posts a Paradime Merge Run Summary note on the merged merge request and updates it as the runs finish.
A merged GitLab merge request with a Paradime Merge Run Summary note: Passed, the merge commit merged into main, and a table with the on_merge_build step, its status, duration, and a link to the run
To run several on-merge schedules in order, or to make merges take turns with a merge queue, see Chains.

Best practices

  • Selective runs: use state:modified+ in your dbt™ command to run only the changed models and their dependencies.
  • Deferred state: set the schedule to defer to its own last successful run, so each run builds only what changed since then.
  • One schedule per target branch: the schedule’s Git branch decides which merges start it. Create one on-merge schedule for each branch you deploy from.

View the output

Each on-merge run shows in the schedule’s run history in Bolt, with its dbt™ artifacts, logs, and the YAML behind the schedule. The Paradime Merge Run Summary note on the merge request links to each run. See Run details.

Run on merge from a GitLab pipeline

First set up the CD Bolt schedule and note its slug, then trigger it from your pipeline on merge.

Generate API keys

To trigger Bolt from your pipeline, generate a Paradime API key with the Bolt schedules admin capability. Generate an Account API key (a prdm_cmp_... Bearer token) and save the token, your workspace token, and the API endpoint; you will add them as CI/CD variables in the next step.

Generate API keys

Create a GitLab pipeline

Create a .gitlab-ci.yml file at the root of your dbt™ repository and enter the values required.
.gitlab-ci.yml

Add the variables in GitLab

Add these as GitLab CI/CD variables:
  • PARADIME_API_SECRET — your account API key (prdm_cmp_...)
  • PARADIME_WORKSPACE_UID — your workspace token
  • PARADIME_API_ENDPOINT