Skip to content

Commit

Permalink
An example in the taskrun doc is not runnable
Browse files Browse the repository at this point in the history
This commit fixes #1855 - an example in the taskrun doc is not runnable.

Two changes were required to make this example in docs/taskruns.md
runnable:

1. "cat README.md" needed to be updated to "cat workspace/README.md"
because the git resource is checked out to /workspace/workspace

2. The TaskRun needed to be moved from above the resource and task
declarations to be the last resource in the document.

As an added bonus I've updated the example to use the script field
instead of `bash -c $(args)`.
  • Loading branch information
Scott authored and tekton-robot committed Jan 13, 2020
1 parent b27e693 commit a1e74a2
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,6 @@ creating `read-repo-run`. Task `read-task` has git input resource and TaskRun

```yaml
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: read-repo-run
spec:
taskRef:
name: read-task
inputs:
resources:
- name: workspace
resourceRef:
name: go-example-git
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: go-example-git
Expand All @@ -406,10 +393,20 @@ spec:
steps:
- name: readme
image: ubuntu
command:
- /bin/bash
args:
- "cat README.md"
script: cat workspace/README.md
---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: read-repo-run
spec:
taskRef:
name: read-task
inputs:
resources:
- name: workspace
resourceRef:
name: go-example-git
```

### Example with embedded specs
Expand Down

0 comments on commit a1e74a2

Please sign in to comment.