Example
This TaskRun executes two steps in order. The first step creates a file, and the second step verifies its existence:How It Works
First Step Runs
The first step sleeps for 3 seconds, then creates a file named
foo. The command is automatically looked up from the container image registry since no explicit command is specified.Second Step Executes
After the first step completes successfully, the second step runs and lists the
foo file to verify it was created.Key Concepts
- Steps: Individual units of execution within a Task
- Sequential Execution: Steps run in order, one after another
- Shared Workspace: Steps share the same filesystem, allowing them to pass data through files
- generateName: Creates a unique name for each TaskRun instance
Expected Output
When this TaskRun executes successfully:- The first step completes after 3 seconds
- The second step finds the
foofile - The TaskRun status shows as “Succeeded”
Next Steps
- Learn how to add parameters to tasks
- Explore using workspaces for more advanced data sharing