-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- move current examples in `examples/v1alpha1` - copy and migrate those examples for `v1alpha1` (in `examples/v1alpha2`) Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
3874ceb
commit 1a66080
Showing
112 changed files
with
3,051 additions
and
18 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
examples/v1alpha2/pipelineruns/clustertask-pipelinerun.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: ClusterTask | ||
metadata: | ||
name: cluster-task-pipeline-4 | ||
spec: | ||
steps: | ||
- name: task-two-step-one | ||
image: ubuntu | ||
command: ["/bin/bash"] | ||
args: ['-c', 'echo success'] | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Pipeline | ||
metadata: | ||
name: sample-pipeline-cluster-task-4 | ||
spec: | ||
tasks: | ||
- name: cluster-task-pipeline-4 | ||
taskRef: | ||
name: cluster-task-pipeline-4 | ||
kind: ClusterTask | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
name: demo-pipeline-run-4 | ||
spec: | ||
pipelineRef: | ||
name: sample-pipeline-cluster-task-4 | ||
serviceAccountName: 'default' |
85 changes: 85 additions & 0 deletions
85
examples/v1alpha2/pipelineruns/conditional-pipelinerun-with-optional-resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Condition | ||
metadata: | ||
name: verify-no-file-exists-without-resource | ||
spec: | ||
params: | ||
- name: "path" | ||
resources: | ||
- name: optional-workspace | ||
type: git | ||
optional: true | ||
check: | ||
image: alpine | ||
script: 'test ! -f $(resources.optional-workspace.path)/$(params.path)' | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineResource | ||
metadata: | ||
name: pipeline-git-repo | ||
spec: | ||
type: git | ||
params: | ||
- name: revision | ||
value: master | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Task | ||
metadata: | ||
name: list-pipeline-repo-files | ||
spec: | ||
resources: | ||
inputs: | ||
- name: optional-workspace | ||
type: git | ||
optional: true | ||
steps: | ||
- name: run-ls | ||
image: ubuntu | ||
script: 'ls -al $(inputs.resources.optional-workspace.path)' | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Pipeline | ||
metadata: | ||
name: pipeline-list-pipeline-repo-files | ||
spec: | ||
resources: | ||
- name: pipeline-source-repo | ||
type: git | ||
params: | ||
- name: "path" | ||
default: "README.md" | ||
tasks: | ||
- name: list-pipeline-repo-files-1 | ||
taskRef: | ||
name: list-pipeline-repo-files | ||
conditions: | ||
- conditionRef: "verify-no-file-exists-without-resource" | ||
params: | ||
- name: "path" | ||
value: "$(params.path)" | ||
# NOTE: Resource "optional-workspace" is declared as optional in Condition | ||
# No resource specified for the condition here since its optional | ||
# "DO NOT UNCOMMENT THE FOLLOWING RESOURCE" | ||
# resources: | ||
# - name: optional-workspace | ||
# resource: pipeline-source-repo | ||
resources: | ||
inputs: | ||
- name: optional-workspace | ||
resource: pipeline-source-repo | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
name: demo-condtional-pr-without-condition-resource | ||
spec: | ||
pipelineRef: | ||
name: pipeline-list-pipeline-repo-files | ||
serviceAccountName: 'default' | ||
resources: | ||
- name: pipeline-source-repo | ||
resourceRef: | ||
name: pipeline-git-repo |
94 changes: 94 additions & 0 deletions
94
examples/v1alpha2/pipelineruns/conditional-pipelinerun.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Condition | ||
metadata: | ||
name: file-exists | ||
spec: | ||
params: | ||
- name: "path" | ||
resources: | ||
- name: workspace | ||
type: git | ||
check: | ||
image: alpine | ||
script: 'test -f $(resources.workspace.path)/$(params.path)' | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineResource | ||
metadata: | ||
name: pipeline-git | ||
spec: | ||
type: git | ||
params: | ||
- name: revision | ||
value: master | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Task | ||
metadata: | ||
name: create-readme-file | ||
spec: | ||
resources: | ||
outputs: | ||
- name: workspace | ||
type: git | ||
steps: | ||
- name: write-new-stuff | ||
image: ubuntu | ||
script: 'touch $(resources.outputs.workspace.path)/README.md' | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Task | ||
metadata: | ||
name: echo-hello | ||
spec: | ||
steps: | ||
- name: echo | ||
image: ubuntu | ||
script: 'echo hello' | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Pipeline | ||
metadata: | ||
name: conditional-pipeline | ||
spec: | ||
resources: | ||
- name: source-repo | ||
type: git | ||
params: | ||
- name: "path" | ||
default: "README.md" | ||
tasks: | ||
- name: first-create-file | ||
taskRef: | ||
name: create-readme-file | ||
resources: | ||
outputs: | ||
- name: workspace | ||
resource: source-repo | ||
- name: then-check | ||
conditions: | ||
- conditionRef: "file-exists" | ||
params: | ||
- name: "path" | ||
value: "$(params.path)" | ||
resources: | ||
- name: workspace | ||
resource: source-repo | ||
from: [first-create-file] | ||
taskRef: | ||
name: echo-hello | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
name: condtional-pr | ||
spec: | ||
pipelineRef: | ||
name: conditional-pipeline | ||
serviceAccountName: 'default' | ||
resources: | ||
- name: source-repo | ||
resourceRef: | ||
name: pipeline-git |
127 changes: 127 additions & 0 deletions
127
examples/v1alpha2/pipelineruns/demo-optional-resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Condition | ||
metadata: | ||
name: check-git-pipeline-resource | ||
spec: | ||
params: | ||
- name: "path" | ||
resources: | ||
- name: git-repo | ||
type: git | ||
optional: true | ||
check: | ||
image: alpine | ||
script: 'test -f $(resources.git-repo.path)/$(params.path)' | ||
--- | ||
|
||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Condition | ||
metadata: | ||
name: check-image-pipeline-resource | ||
spec: | ||
resources: | ||
- name: built-image | ||
type: image | ||
optional: true | ||
check: | ||
image: alpine | ||
script: 'test ! -z $(resources.built-image.url)' | ||
--- | ||
|
||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Task | ||
metadata: | ||
name: build-an-image | ||
spec: | ||
params: | ||
- name: DOCKERFILE | ||
description: The path to the dockerfile to build from GitHub Repo | ||
default: "Dockerfile" | ||
resources: | ||
inputs: | ||
- name: git-repo | ||
type: git | ||
optional: true | ||
outputs: | ||
- name: built-image | ||
type: image | ||
optional: true | ||
steps: | ||
- name: build-an-image | ||
image: "gcr.io/kaniko-project/executor:latest" | ||
command: | ||
- /kaniko/executor | ||
args: | ||
- --dockerfile=$(params.DOCKERFILE) | ||
- --destination=$(resources.outputs.built-image.url) | ||
--- | ||
|
||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Pipeline | ||
metadata: | ||
name: demo-pipeline-to-build-an-image | ||
spec: | ||
resources: | ||
- name: source-repo | ||
type: git | ||
optional: true | ||
- name: web-image | ||
type: image | ||
optional: true | ||
params: | ||
- name: "path" | ||
default: "README.md" | ||
tasks: | ||
- name: build-an-image | ||
taskRef: | ||
name: build-an-image | ||
conditions: | ||
- conditionRef: "check-git-pipeline-resource" | ||
params: | ||
- name: "path" | ||
value: "$(params.path)" | ||
resources: | ||
- name: git-repo | ||
resource: source-repo | ||
- conditionRef: "check-image-pipeline-resource" | ||
resources: | ||
- name: built-image | ||
resource: web-image | ||
resources: | ||
inputs: | ||
- name: git-repo | ||
resource: source-repo | ||
outputs: | ||
- name: built-image | ||
resource: web-image | ||
|
||
--- | ||
|
||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
name: demo-pipeline-to-build-an-image-without-resources | ||
spec: | ||
pipelineRef: | ||
name: demo-pipeline-to-build-an-image | ||
serviceAccountName: 'default' | ||
--- | ||
|
||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
name: demo-pipeline-to-build-an-image-without-image-resource | ||
spec: | ||
pipelineRef: | ||
name: demo-pipeline-to-build-an-image | ||
serviceAccountName: 'default' | ||
resources: | ||
- name: source-repo | ||
resourceSpec: | ||
type: git | ||
params: | ||
- name: revision | ||
value: master | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline | ||
--- |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
apiVersion: v1 | ||
kind: LimitRange | ||
metadata: | ||
name: limit-mem-cpu-per-container | ||
spec: | ||
limits: | ||
- max: | ||
cpu: "800m" | ||
memory: "1Gi" | ||
min: | ||
cpu: "100m" | ||
memory: "99Mi" | ||
default: | ||
cpu: "700m" | ||
memory: "900Mi" | ||
defaultRequest: | ||
cpu: "110m" | ||
memory: "111Mi" | ||
type: Container | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Task | ||
metadata: | ||
name: echo-hello-world | ||
spec: | ||
steps: | ||
- name: echo | ||
image: ubuntu | ||
command: | ||
- echo | ||
args: | ||
- "hello world" | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: Pipeline | ||
metadata: | ||
name: pipeline-hello | ||
spec: | ||
tasks: | ||
- name: hello-world-1 | ||
taskRef: | ||
name: echo-hello-world | ||
- name: hello-world-2 | ||
taskRef: | ||
name: echo-hello-world | ||
runAfter: | ||
- hello-world-1 | ||
--- | ||
apiVersion: tekton.dev/v1alpha2 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: pipeline-hello-run- | ||
spec: | ||
pipelineRef: | ||
name: pipeline-hello | ||
limitRangeName: "limit-mem-cpu-per-container" | ||
status: {} |
Oops, something went wrong.