> For the complete documentation index, see [llms.txt](https://docs.cloudbeat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudbeat.io/features/integrations/ci-cd-tools.md).

# CI/CD Pipeline

Running your tests in CloudBeat from CI/CD pipeline

You can trigger and run your tests in CloudBeat from CI pipeline. CloudBeat takes the hassle of parallelizing and scaling your tests in the CI pipeline, grouping test results and providing standard integration with your CI tool based on JUnit XML format. Beyond the standard JUnit XML based reporting, you can benefit from AI-driven root-cause analysis and quality gating inside CloudBeat UI.

### How it works

1. Install the [CloudBeat CLI](/references/cloudbeat-cli.md) in the pipeline (`npm install -g @cloudbeat/cli`, Node.js 18 or newer).
2. Provide your CloudBeat API key through the pipeline's secret store, as the `CB_API_KEY` environment variable. For a self-hosted CloudBeat installation, also set `CB_API_URL`.
3. Run the test case or suite with `cloudbeat-cli start`. The command waits for the run to finish, writes a JUnit XML report to the working directory, and exits with code 1 when the run fails, so the pipeline step fails with it.
4. Publish the JUnit XML report with your CI tool's test results step.

```bash
npm install -g @cloudbeat/cli
cloudbeat-cli start suite 34984 --env Staging --release "$BUILD_VERSION"
```

Step by step guides: [Jenkins](/features/integrations/ci-cd-tools/jenkins.md) and [Azure DevOps](/features/integrations/ci-cd-tools/azure-tfs.md). The full list of arguments and options is in the CLI reference: [Running Tests](/references/cloudbeat-cli/running-tests.md).

### Delivering code from the pipeline

Projects which are synchronized with Git pick up new code from the repository. For projects whose code is uploaded - for example .NET test projects, which CloudBeat runs as compiled binaries - the pipeline can upload the latest build before running the tests:

```bash
dotnet build -c Release
cloudbeat-cli project sync "Bank UI" --dir bin/Release/net8.0 --all --wait
```

See [Projects and Code Delivery](/references/cloudbeat-cli/projects-and-code-delivery.md).
