Tekton Concepts: Difference between revisions
Jump to navigation
Jump to search
Line 37: | Line 37: | ||
==Pipeline== | ==Pipeline== | ||
<syntaxhighlight lang='yaml'> | |||
apiVersion: tekton.dev/v1beta1 | |||
kind: Task | |||
metadata: | |||
name: task1 | |||
spec: | |||
steps: | |||
- name: echo | |||
image: alpine | |||
script: | | |||
#!/bin/sh | |||
echo "this is Task 1 output" | |||
--- | |||
apiVersion: tekton.dev/v1beta1 | |||
kind: Task | |||
metadata: | |||
name: task2 | |||
spec: | |||
steps: | |||
- name: echo | |||
image: alpine | |||
script: | | |||
#!/bin/sh | |||
echo "this is Task 2 output" | |||
--- | |||
apiVersion: tekton.dev/v1beta1 | |||
kind: Pipeline | |||
metadata: | |||
name: simple-pipeline | |||
spec: | |||
tasks: | |||
- name: task1 | |||
taskRef: | |||
name: task1 | |||
- name: task2 | |||
runAfter: | |||
- task1 | |||
taskRef: | |||
name: task2 | |||
</syntaxhighlight> | |||
==PipelineRun== | ==PipelineRun== | ||
Revision as of 23:02, 27 April 2022
Internal
Overview
Tekton Domain Model
Task
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: hello
spec:
steps:
- name: echo
image: alpine
script: |
#!/bin/sh
echo "Hello World"
Task Operations
TaskRun
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: hello-task-run
spec:
taskRef:
name: hello
TaskRun Operations
Pipeline
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: task1
spec:
steps:
- name: echo
image: alpine
script: |
#!/bin/sh
echo "this is Task 1 output"
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: task2
spec:
steps:
- name: echo
image: alpine
script: |
#!/bin/sh
echo "this is Task 2 output"
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: simple-pipeline
spec:
tasks:
- name: task1
taskRef:
name: task1
- name: task2
runAfter:
- task1
taskRef:
name: task2