Deploy inference rules allow you to create DX deployments based on jobs that run in your CI/CD jobs. Whereas the Deployments API is a flexible solution for handling a wide range of deployment mechanisms, inference rules are a no-code solution for simple deployment workflows.
Setup instructions
Deployment inference rules are configured in the DX user interface. To set up a rule, specify the following parameters:
Pipeline Source: Select from Github Actions, GitLab, CircleCI, and other options based on connections you have configured in DX.
CI/CD Level:
GitHub Actions & CircleCI: Automatically set to "Workflow".
Buildkite: Automatically set to "Pipeline."
GitLab & Azure DevOps: Option to select either "Pipeline" or "Stage".
Repository: Select one from the dropdown, or input a regular expression.
Integration branch (optional): Set this value if you are using a branch to integrate changes before merging to a release branch.
Workflow: Select the specific workflow, pipeline, or stage for which you want a deployment to be generated from the dropdown.
Target branch: The Git branch for which you want to infer deployments from (e.g.
master
,development
).Service: The name of service being deployed.
DX supports regular expressions for creating rules for multiple repositories and/or workflows at once. Below are a few common examples:
RegEx Expression | Use case |
| Create a rule that applies to all repositories. |
| Create a rule for all jobs that include the term "deploy". |
| Create a rule for repositories beginning with "mobile-". |
CI/CD levels
The second field for an inference rule is the CI/CD level. The table below lists CI/CD levels for each provider, with DX-supported levels highlighted in bold:
Provider | CI/CD levels |
Azure Pipelines | Project > Repository > Pipeline > Stage > Job > Step |
CircleCI | Project > Pipeline > Workflow > Job > Step |
Buildkite | Pipeline > Step > Job |
GitHub | Repository > Workflow > Job > Step |
GitLab | Project > Pipeline > Stage > Job |
Testing
To verify that a deploy inference rule works, trigger a pipeline/workflow/stage to run on the relevant branch, then confirm that a deployment was created in DX with a deployment_inference_rule_id
corresponding to the rule.
Backfilling
Once your rules are setup and verified, you may wish to have deployment data backfilled using your historical data. Please contact DX support to request that a one-time backfill be performed.