initial commit
This commit is contained in:
11
dev/tekton/examples/workspaces/pipeline-run.yaml
Executable file
11
dev/tekton/examples/workspaces/pipeline-run.yaml
Executable file
@@ -0,0 +1,11 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: PipelineRun
|
||||
metadata:
|
||||
generateName: pr-different-path-
|
||||
spec:
|
||||
pipelineRef:
|
||||
name: pipeline-using-different-subpaths
|
||||
workspaces:
|
||||
- name: ws
|
||||
persistentVolumeClaim:
|
||||
claimName: workspace-pvc
|
||||
69
dev/tekton/examples/workspaces/pipeline.yaml
Executable file
69
dev/tekton/examples/workspaces/pipeline.yaml
Executable file
@@ -0,0 +1,69 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: writer
|
||||
spec:
|
||||
steps:
|
||||
- name: write
|
||||
image: ubuntu
|
||||
script: echo bar > $(workspaces.task-ws.path)/foo
|
||||
workspaces:
|
||||
- name: task-ws
|
||||
---
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: read-both
|
||||
spec:
|
||||
params:
|
||||
- name: directory1
|
||||
type: string
|
||||
- name: directory2
|
||||
type: string
|
||||
workspaces:
|
||||
- name: local-ws
|
||||
steps:
|
||||
- name: read-1
|
||||
image: ubuntu
|
||||
script: cat $(workspaces.local-ws.path)/$(params.directory1)/foo | grep bar
|
||||
- name: read-2
|
||||
image: ubuntu
|
||||
script: cat $(workspaces.local-ws.path)/$(params.directory2)/foo | grep bar
|
||||
---
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Pipeline
|
||||
metadata:
|
||||
name: pipeline-using-different-subpaths
|
||||
spec:
|
||||
workspaces:
|
||||
- name: ws
|
||||
tasks:
|
||||
- name: writer-1
|
||||
taskRef:
|
||||
name: writer
|
||||
workspaces:
|
||||
- name: task-ws
|
||||
workspace: ws
|
||||
subPath: dir-1
|
||||
- name: writer-2
|
||||
runAfter:
|
||||
- writer-1
|
||||
taskRef:
|
||||
name: writer
|
||||
workspaces:
|
||||
- name: task-ws
|
||||
workspace: ws
|
||||
subPath: dir-2
|
||||
- name: read-all
|
||||
runAfter:
|
||||
- writer-2
|
||||
params:
|
||||
- name: directory1
|
||||
value: dir-1
|
||||
- name: directory2
|
||||
value: dir-2
|
||||
taskRef:
|
||||
name: read-both
|
||||
workspaces:
|
||||
- name: local-ws
|
||||
workspace: ws
|
||||
18
dev/tekton/examples/workspaces/task.yaml
Executable file
18
dev/tekton/examples/workspaces/task.yaml
Executable file
@@ -0,0 +1,18 @@
|
||||
|
||||
spec:
|
||||
steps:
|
||||
- name: write-message
|
||||
image: ubuntu
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
if [ "$(workspaces.messages.bound)" == "true" ] ; then
|
||||
echo hello! > $(workspaces.messages.path)/message
|
||||
fi
|
||||
workspaces:
|
||||
- name: messages
|
||||
description: |
|
||||
The folder where we write the message to. If no workspace
|
||||
is provided then the message will not be written.
|
||||
optional: true
|
||||
mountPath: /home/ubuntu/tekton
|
||||
19
dev/tekton/examples/workspaces/workspace-pv.yaml
Executable file
19
dev/tekton/examples/workspaces/workspace-pv.yaml
Executable file
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: workspace-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.40.100
|
||||
path: /mnt/nfs_share/workspace
|
||||
readOnly: false
|
||||
|
||||
16
dev/tekton/examples/workspaces/workspace-pvc.yaml
Executable file
16
dev/tekton/examples/workspaces/workspace-pvc.yaml
Executable file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: workspace-pvc
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: workspace-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user