Skip to content

Commit 76770ef

Browse files
committed
docs(resolver): Reorganize in-repo pipeline and task documentation
Restructure documentation so information shared between Pipeline and Task resolution is consolidated. Ensures both Task and Pipelines each have the same level of documentation for in-repo resolution, linking to shared section
1 parent f1112fd commit 76770ef

File tree

1 file changed

+43
-14
lines changed

1 file changed

+43
-14
lines changed

docs/content/docs/guide/resolver.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,23 +191,16 @@ or `GitLab` raw URL like this:
191191

192192
The GitLab token as provider in the Repository CR will be used to fetch the file.
193193

194-
### Tasks or Pipelines inside the repository
194+
### Tasks inside the repository
195195

196-
Additionally, you can as well have a reference to a task or pipeline from a YAML file inside
197-
your repository if you specify the relative path to it, for example :
196+
Additionally, you can also reference a task or pipeline from a YAML file inside
197+
your repository if you specify the path to it. For example:
198198

199199
```yaml
200200
pipelinesascode.tekton.dev/task: "[share/tasks/git-clone.yaml]"
201201
```
202202

203-
This will grab the file `share/tasks/git-clone.yaml` from the current
204-
repository on the `SHA` where the event come from (i.e: the current pull
205-
request or the current branch push).
206-
207-
If there is any error fetching those resources, `Pipelines-as-Code` will error
208-
out and not process the pipeline.
209-
210-
If the object fetched cannot be parsed as a Tekton `Task` it will error out.
203+
See [Tasks and Pipelines inside the repository](#tasks-or-pipelines-inside-the-repository) for details.
211204

212205
### Relative Tasks
213206

@@ -286,12 +279,17 @@ An annotation to a remote pipeline looks like this, using a remote URL:
286279
pipelinesascode.tekton.dev/pipeline: "https://git.provider/raw/pipeline.yaml
287280
```
288281

289-
or from a relative path inside the repository:
282+
### Pipelines inside the repository
283+
284+
Additionally, you can also reference a Task or Pipeline from a YAML file inside
285+
your repository if you specify the path to it. For example:
290286

291287
```yaml
292-
pipelinesascode.tekton.dev/pipeline: "./tasks/pipeline.yaml
288+
pipelinesascode.tekton.dev/pipeline: "pipelines/my-pipeline.yaml
293289
```
294290

291+
See [Tasks and Pipelines inside the repository](#tasks-or-pipelines-inside-the-repository) for details.
292+
295293
### Hub Support for Pipelines
296294

297295
```yaml
@@ -372,7 +370,7 @@ to a `Name`, no override is done on `Tasks` embedded with a `taskSpec`. See
372370
[Tekton documentation](https://tekton.dev/docs/pipelines/pipelines/#adding-tasks-to-the-pipeline) for the differences between `taskRef` and `taskSpec`:
373371
{{< /hint >}}
374372

375-
### Tasks or Pipelines Precedence
373+
## Tasks or Pipelines Precedence
376374

377375
From where tasks or pipelines of the same name takes precedence?
378376

@@ -389,3 +387,34 @@ pipeline in this order:
389387
1. The Pipeline from the PipelineRun annotations
390388
2. The Pipeline from the Tekton directory (pipelines are automatically fetched from
391389
the `.tekton` directory and its sub-directories)
390+
391+
## Tasks or Pipelines inside the repository
392+
393+
You can also reference a task or pipeline from a YAML file inside
394+
your repository by specifying the path to the file.
395+
For example:
396+
397+
To reference a Task yaml file in the repository
398+
399+
```yaml
400+
pipelinesascode.tekton.dev/task: "[share/tasks/git-clone.yaml]"
401+
```
402+
403+
To reference a Pipeline yaml file in the repository
404+
405+
```yaml
406+
pipelinesascode.tekton.dev/pipeline: "share/pipelines/build.yaml"
407+
```
408+
409+
This will grab the specified file(s) from the current
410+
repository on the `SHA` where the event comes from (i.e: the current pull
411+
request or the current branch push).
412+
413+
If there is any error fetching those resources, or if the fetched yaml
414+
cannot be parsed as the appropriate Tekton type , `Pipelines-as-Code`
415+
will error out and not process the pipeline.
416+
417+
it will error out.
418+
419+
Remote Pipelines may also reference Tasks in their repository using a relative path.
420+
See [Relative Tasks](#relative-tasks) for details.

0 commit comments

Comments
 (0)