The build and deploy Tasks
Let's learn about the build and deploy Tasks using Tekton Pipelines directly through the manifest.
We'll cover the following...
The build
Task
Let’s start with the build
Task. This Task will take in inputs (like the Git repository URL) and build and publish an image. We’ve already created a file named task-build.yaml
. First, we need to run the command mentioned in taskBuild.sh
.
Note: Click the “Run” button under the widget shown below and enter the commands in the terminal.
To run all the commands written in a
.sh
file, just type./file-name.sh
in the terminal.
kubectl apply -f task-build.yaml
The Task definition, as mentioned in task-build.yaml
, defines a Task with the name build
. The Task takes multiple inputs (such as the Git repository URL) and outputs a container image. These inputs and outputs are referred to as resources in Tekton. The params
field defines input parameters for the Task. For example, repo-URL
represents the Git repository to clone. A Task can emit string results, defined in the results
field, whose values can be viewed by users or passed to other Tasks in a pipeline. The published image is returned for the build
Task we created.
The Task has the following two steps:
-
The git-clone step uses the alpine/git image to ...