docs/versioned_docs/version-1.0-beta/adopting/triggers/tekton.mdx
Dagger runs dagger check as a Tekton Task, so the same checks you run locally run on every PipelineRun — while keeping all of your existing Tekton infrastructure.
:::tip
For checks with no pipeline YAML at all, enable Cloud Checks with dagger ws autocheck on. The Tekton Task below is the hybrid-mode alternative for when you want to drive Dagger from your existing Tekton setup.
:::
Tekton provides capabilities which allow you to run dagger check as a Tekton Task without needing any external configuration. This integration uses the standard architecture for Tekton and adds a Dagger Engine sidecar which gives each Tekton PipelineRun its own Dagger Engine. The Task runs dagger check against the modules installed in your workspace.
To trigger a pipeline run, you can use the Tekton CLI (tkn), or you can configure events in Tekton to run it automatically as desired.
kubectl profile.dagger/config.toml) — see Workspace SetupThe following example runs dagger check for a simple Go application.
Install the git-clone Task from Tekton Hub. This Task adds repository cloning capabilities to the Tekton Pipeline. Use the following command:
tkn hub install task git-clone
Define a new Tekton Pipeline as follows, in a file named git-pipeline.yaml:
This Pipeline references two Tasks:
git-clone Task, to check out the Git repository for the project into a Tekton Workspace;dagger Task, to run dagger check for the project (defined below).Define a new Tekton Task as follows, in a file named dagger-task.yaml:
This Tekton Task installs the Dagger CLI and runs dagger check against the modules installed in your workspace (which was checked out in the previous Tekton Pipeline).
In this Tekton Task, the Dagger Engine runs as a sidecar and shares a socket with the Task itself. The Task uses dind as its runtime in order to have Docker available.
Define a new Tekton PipelineRun as follows, in a file named git-pipeline-run.yaml:
This PipelineRun corresponds to the Tekton Pipeline created previously. It executes the Tekton Pipeline with a given set of input parameters: the Git repository URL and an optional Dagger Cloud token.
To apply the configuration and run the Tekton Pipeline, use the following commands:
kubectl apply -f dagger-task.yaml
kubectl apply -f git-pipeline-yaml
kubectl create -f git-pipeline-run.yaml
To see the logs from the PipelineRun, obtain the PipelineRun name from the output and run tkn pipelinerun logs clone-read-run-<id> -f.
If you have any questions about additional ways to use Tekton with Dagger, join our Discord and ask your questions in our Kubernetes channel.
Tekton is a Kubernetes-based framework for creating, managing and running CI/CD pipelines.