Skip to content

Commit b7b94ea

Browse files
authored
Merge pull request #78408 from buildbricks/http-resolver-updates
Pipelines 5989: HTTP Resolver docs
2 parents 05c3349 + e01d9a6 commit b7b94ea

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

create/remote-pipelines-tasks-resolvers.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ Hub resolver:: Retrieves a task or pipeline from the Pipelines Catalog available
1818
Bundles resolver:: Retrieves a task or pipeline from a Tekton bundle, which is an OCI image available from any OCI repository, such as an OpenShift container repository.
1919
Cluster resolver:: Retrieves a task or pipeline that is already created on the same {OCP} cluster in a specific namespace.
2020
Git resolver:: Retrieves a task or pipeline binding from a Git repository. You must specify the repository, the branch, and the path.
21+
HTTP resolver:: Retrieves a task or pipeline from a remote HTTP or HTTPS URL. You must specify the URL for authentication.
2122

2223
An {pipelines-shortname} installation includes a set of standard tasks that you can use in your pipelines. These tasks are located in the {pipelines-shortname} installation namespace, which is normally the `openshift-pipelines` namespace. You can use the cluster resolver to access the tasks.
2324

2425
[id="resolver-hub_{context}"]
2526
== Specifying a remote pipeline or task from a Tekton catalog
27+
2628
You can use the hub resolver to specify a remote pipeline or task that is defined either in a public Tekton catalog of link:https://artifacthub.io/[{artifact-hub}] or in an instance of {tekton-hub}.
2729

2830
[IMPORTANT]
@@ -70,6 +72,15 @@ include::modules/op-resolver-git-config-scm.adoc[leveloffset=+2]
7072
include::modules/op-resolver-git-scm.adoc[leveloffset=+2]
7173
include::modules/op-resolver-git-override-scm.adoc[leveloffset=+2]
7274

75+
[id="resolver-http_{context}"]
76+
== Specifying a remote pipeline or task by using the HTTP resolver
77+
78+
You can specify a remote pipeline or task from an HTTP or HTTPS URL by using the HTTP resolver. The URL must point to a YAML file that defines the pipeline or task.
79+
80+
include::modules/op-resolver-http-config.adoc[leveloffset=+2]
81+
include::modules/op-resolver-http.adoc[leveloffset=+2]
82+
83+
7384
[role="_additional-resources"]
7485
[id="additional-resources_{context}"]
7586
== Additional resources

modules/op-resolver-http-config.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This module is included in the following assemblies:
2+
// * create/remote-pipelines-tasks-resolvers.adoc
3+
4+
// // *openshift_pipelines/remote-pipelines-tasks-resolvers.adoc
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="resolver-http-config_{context}"]
8+
= Configuring the HTTP resolver
9+
10+
You can use the HTTP resolver to fetch pipelines or tasks from an HTTP URL. You can configure the default values for the HTTP resolver by editing the `TektonConfig` custom resource (CR).
11+
12+
.Procedure
13+
14+
. Edit the `TektonConfig` CR by entering the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc edit TektonConfig config
19+
----
20+
. In the `TektonConfig` CR, edit the `pipeline.http-resolver-config` spec:
21+
+
22+
[source,yaml]
23+
----
24+
apiVersion: operator.tekton.dev/v1alpha1
25+
kind: TektonConfig
26+
metadata:
27+
name: config
28+
spec:
29+
pipeline:
30+
http-resolver-config:
31+
fetch-timeout: "1m" # <1>
32+
----
33+
<1> The maximum amount of time the HTTP resolver waits for a response from the server.
34+

modules/op-resolver-http.adoc

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// This module is included in the following assemblies:
2+
// * create/remote-pipelines-tasks-resolvers.adoc
3+
4+
// // *openshift_pipelines/remote-pipelines-tasks-resolvers.adoc
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="resolver-http-specify_{context}"]
7+
= Specifying a remote pipeline or task with the HTTP Resolver
8+
9+
When creating a pipeline run or task run, you can specify a remote pipeline or task from an HTTP or HTTPS URL.
10+
11+
.Procedure
12+
13+
* Specify a remote pipeline or task from an HTTP URL, using the following format in the `pipelineRef` or `taskRef` spec:
14+
+
15+
[source,yaml]
16+
----
17+
# ...
18+
resolver: http
19+
params:
20+
- name: url
21+
value: <fully_qualified_http_url>
22+
# ...
23+
----
24+
+
25+
.Supported parameters for the HTTP Resolver
26+
|===
27+
| Parameter | Description | Example Value
28+
29+
| `url`
30+
| The HTTP URL pointing to the Tekton resource to fetch.
31+
| `https://raw.githubusercontent.com/openshift-pipelines/tektoncd-catalog/p/tasks/task-git-clone/0.4.0/task-git-clone.yaml`
32+
|===
33+
34+
The following example pipeline run references a remote pipeline from the same cluster:
35+
36+
[source,yaml]
37+
----
38+
apiVersion: tekton.dev/v1beta1
39+
kind: PipelineRun
40+
metadata:
41+
name: http-pipeline-reference-demo
42+
spec:
43+
pipelineRef:
44+
resolver: http
45+
params:
46+
- name: url
47+
value: https://raw.githubusercontent.com/tektoncd/catalog/main/pipeline/build-push-gke-deploy/0.1/build-push-gke-deploy.yaml
48+
params:
49+
- name: sample-pipeline-parameter
50+
value: test
51+
- name: username
52+
value: "pipelines"
53+
----
54+
55+
The following example pipeline defines a task that references a remote task from the same cluster:
56+
57+
[source,yaml]
58+
----
59+
apiVersion: tekton.dev/v1beta1
60+
kind: Pipeline
61+
metadata:
62+
name: pipeline-with-http-task-reference-demo
63+
spec:
64+
tasks:
65+
- name: "http-task-demo"
66+
taskRef:
67+
resolver: http
68+
params:
69+
- name: url
70+
value: https://raw.githubusercontent.com/openshift-pipelines/tektoncd-catalog/p/tasks/task-git-clone/0.4.0/task-git-clone.yaml
71+
params:
72+
- name: sample-task-parameter
73+
value: test
74+
----
75+
76+
The following example task run references a remote task from the same cluster:
77+
78+
[source,yaml]
79+
----
80+
apiVersion: tekton.dev/v1beta1
81+
kind: TaskRun
82+
metadata:
83+
name: http-task-reference-demo
84+
spec:
85+
taskRef:
86+
resolver: http
87+
params:
88+
- name: url
89+
value: https://raw.githubusercontent.com/openshift-pipelines/tektoncd-catalog/p/tasks/task-git-clone/0.4.0/task-git-clone.yaml
90+
params:
91+
- name: sample-task-parameter
92+
value: test
93+
----

0 commit comments

Comments
 (0)