CI and CD pipelines require automation, automation of tests, builds and deployments.
I’ve written before about Tekton, and using EventListeners to drive pipelines.
More recently, I’ve been looking at ways to simplify the configuration of deploying these pipelines.
Introducing Tekton CI, which makes it easy to define the pipeline configuration in the same repository as the code resides.
This is an early alpha-release, it works, but it’s under heavy development.
The Deployment exposes an HTTP service on 8080 with two endpoints.
The container supports two different formats for driving pipelines, both accept
PullRequest hooks and fetch a pipeline definition from the source
/pipelinewill drive a simplified script-based PipelineDSL
/pipelinerunwill drive pipelines directly from a PipelineRun definition.
/pipeline endpoint will look for a file called
.tekton_ci.yaml in the
root of the repository.
It supports a simplified script format, see this example.
When a PullRequest is opened, this will be executed as a PipelineRun with an embedded Pipeline, with embedded Tasks based on the scripts in the definition.
The source is checked out to a shared volume and the scripts are executed in the “root” of the checked out code.
/pipelinerun endpoint will look for a file called
# This is a CEL expression filter: hook.Action == 'opened' # These are applied to the created PipelineRun, the expression is a CEL # expression, and the `hook` value is an scm Hook value, for example # https://github.com/jenkins-x/go-scm/blob/master/scm/webhook.go#L251 paramBindings: - name: COMMIT_SHA expression: hook.PullRequest.Sha # this is a standard Pipeline Run specification. pipelineRunSpec: pipelineSpec: params: - name: COMMIT_SHA description: "The commit from the pull_request" type: string tasks: - name: echo-commit taskSpec: params: - name: COMMIT type: string steps: - name: echo image: ubuntu script: | #!/usr/bin/env bash echo "$(params.COMMIT)" params: - name: COMMIT value: $(params.COMMIT_SHA)
Feel free to build and install the code, and submit issues or feedback.