Building your first task
In this section, you will create your first Hello World task. While this task might not be instrumental in your day-to-day life, it will demonstrate the basic concepts to build your first Tekton task:
- First, start with a new YAML file called
hello.yaml
. In that file, start by specifying the API version to use and the kind of object described:apiVersion: tekton.dev/v1beta1 kind: Task
- Next, add in some metadata. For this first example, we will stick with the bare minimum and only add a task name:
metadata: name: hello
- Now that you've described the task and named it, you can add a spec for it. Here, it will contain a single step:
spec: steps:
For this single step, you will use the Universal Base Images UBI image to run a Bash script.
About the UBI
Red Hat UBI offers a lightweight version of Red Hat Enterprise Linux as a base image to build your containers. It offers great reliability and high security for your containers...