Skip to main content

TeamCity

TeamCity provides a Dagger Recipe that runs dagger check in any build configuration, so the same checks you run locally run on every build — while keeping all of your existing TeamCity infrastructure. The recipe is taken from the JetBrains Marketplace.

tip

For checks with no build configuration at all, enable Cloud Checks with dagger ws autocheck on. The recipe below is the hybrid-mode alternative for when you want to drive Dagger from your existing TeamCity setup.

How it works​

When running a CI pipeline with Dagger using TeamCity, the general workflow looks like this:

  1. A new build is triggered.
  2. The build is sent to an available TeamCity agent.
  3. The Dagger Recipe installs the required version of Dagger CLI on the agent.
  4. The Dagger CLI attempts to find an existing Dagger Engine or spins up a new one.
  5. The Dagger CLI runs dagger check against the modules installed in your workspace and sends telemetry to Dagger Cloud if the DAGGER_CLOUD_TOKEN environment variable is set.
  6. The build completes successfully or fails based on the check results. Logs appear in TeamCity as usual.

Prerequisites​

Running the examples shown below requires:

  1. A running TeamCity server.
  2. At least one TeamCity agent with Docker installed.
  3. A repository for storing build configurations as code, with a Dagger workspace (.dagger/config.toml) — see Workspace Setup.

Example​

The following code sample demonstrates how to integrate Dagger with TeamCity to run dagger check. The code is written using the TeamCity Kotlin DSL.

settings.kts
import jetbrains.buildServer.configs.kotlin.*

version = "2025.07"

project {
buildType(Greeter)
}

object Greeter : BuildType({
name = "say hi!"

// to select agents with Docker
requirements {
exists("docker.server.version")
}

steps {
step {
id = "hello from dagger"

// type consists of the "tc:recipe:" prefix followed by the recipe id
type = "tc:recipe:jetbrains/dagger@1.0.0"

// recipe inputs
param("env.input_version", "0.19.2")
param("env.input_command", "dagger check")
}
}
})

Resources​

About TeamCity​

TeamCity is a popular CI/CD tool developed by JetBrains.