Example
How It Works
1
Declare Results
The task declares two results in the
results section, each with a name and description. This tells Tekton to create files where result values can be written.2
Write to Result Files
Each step writes its output to a result file using
$(results.NAME.path). The tee command both prints the output and writes it to the result file.3
Results are Captured
After the task completes, Tekton reads the content from the result files and makes them available in the TaskRun status.
Writing Results
To write a result value:tee to both display and write:
Result values must be plain text strings. Tekton will trim any trailing newlines from result values.
Expected Output
The task will output something like:Key Concepts
- Results: Named output values from a task
- Result Path: Use
$(results.NAME.path)to get the file path where the result should be written - Result Size: Results have a maximum size (typically 4KB for string results)
- Result Usage: Results can be passed to other tasks in a pipeline using
$(tasks.TASK_NAME.results.RESULT_NAME)
Next Steps
- See how to use results in pipelines
- Learn about passing results between tasks