January 9, 2020 By Xiaocong Ji 2 min read

Step-by-step instructions on how to define a Tekton-enabled template and use it to create and pre-config a Tekton Pipeline.

Tekton Pipelines is an open source project (born out of Knative Build) that you can use to configure and run continuous integration/continuous delivery (CI/CD) pipelines within a Kubernetes cluster. 

Tekton Pipelines are cloud native and run on Kubernetes using custom resource definitions specialized for executing CI/CD workflows, and they can be created and configured by using a YAML template. 

This post will show you how to define a Tekton-enabled YAML template and use it to automatically create and pre-config a Tekton Pipeline.

Defining a Tekton-enabled template

The Tekton Pipeline needs to define a private worker, git inputs , triggers, and essential properties, and these specifications can be defined into a single YAML document. 

The following is a tekton.yaml example:

private_worker: ${PRIVATE_WORKER}
- type: git
  branch: master
  service: ${SAMPLE_REPO}
- type: git
  name: Trigger
  service: ${SAMPLE_REPO}
  branch: master
  events: {"push":true,"pull_request":true,"pull_request_closed":false}
  eventListener: listener
  value: .
  type: text
  value: Dockerfile
  type: text 
  value: 123456
  type: SECURE

The above YAML contains the references to environment variables (enclosed with `${}`) that are defined as a part of configuration in the Pipeline service definition of toolchain.yaml. 

For more detailed information, see “Tekton Pipeline YAML Format.”

Using the template to create and config a Tekton pipeline

  1. After you have followed the instructions above and the template is ready, you can go to IBM Cloud to create a toolchain page and redirect to your template link. Here is a public example template
  2. Paste the API Key for the pipeline and the Service-id API Key for the private worker (if the private work needs to be set).
  3. You can then can click the Create button and a configured Tekton pipeline will be ready to use.

The Tekton-enabled template allows you to automatically configure a Tekton pipeline, and it is great for helping groups of people get new projects up and running quickly with a known set of well-integrated tools.

Contact us

Now you can try it out yourself. For more information, see our documentation. If you have questions, engage our team via Slack by registering here and join the discussion in the #ask-your-question channel on our public Cloud DevOps @ IBM Slack.

We’d love to hear your feedback.

Learn more about Tekton by reading “Build and Deliver Using Tekton-Enabled Pipelines” and watching our video, “What is Tekton?”:

Was this article helpful?

More from Cloud

A clear path to value: Overcome challenges on your FinOps journey 

3 min read - In recent years, cloud adoption services have accelerated, with companies increasingly moving from traditional on-premises hosting to public cloud solutions. However, the rise of hybrid and multi-cloud patterns has led to challenges in optimizing value and controlling cloud expenditure, resulting in a shift from capital to operational expenses.   According to a Gartner report, cloud operational expenses are expected to surpass traditional IT spending, reflecting the ongoing transformation in expenditure patterns by 2025. FinOps is an evolving cloud financial management discipline…

IBM Power8 end of service: What are my options?

3 min read - IBM Power8® generation of IBM Power Systems was introduced ten years ago and it is now time to retire that generation. The end-of-service (EoS) support for the entire IBM Power8 server line is scheduled for this year, commencing in March 2024 and concluding in October 2024. EoS dates vary by model: 31 March 2024: maintenance expires for Power Systems S812LC, S822, S822L, 822LC, 824 and 824L. 31 May 2024: maintenance expires for Power Systems S812L, S814 and 822LC. 31 October…

24 IBM offerings winning TrustRadius 2024 Top Rated Awards

2 min read - TrustRadius is a buyer intelligence platform for business technology. Comprehensive product information, in-depth customer insights and peer conversations enable buyers to make confident decisions. “Earning a Top Rated Award means the vendor has excellent customer satisfaction and proven credibility. It’s based entirely on reviews and customer sentiment,” said Becky Susko, TrustRadius, Marketing Program Manager of Awards. Top Rated Awards have to be earned: Gain 10+ new reviews in the past 12 months Earn a trScore of 7.5 or higher from…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters