Skip to content

Commit 47711b7

Browse files
authored
Merge pull request #33967 from sounix000/Replace-pipeline-templates-in-import-flows-RHDEVDOCS-2886
RHDEVDOCS-2886: Docs for using custom pipeline template in Git import workflows
2 parents adc7277 + 19d305d commit 47711b7

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

cicd/pipelines/working-with-pipelines-using-the-developer-perspective.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ To create pipelines along with applications, use the *From Git* option in the *A
3535

3636
include::modules/op-interacting-with-pipelines-using-the-developer-perspective.adoc[leveloffset=+1]
3737

38+
include::modules/op-using-custom-pipeline-template-for-git-import.adoc[leveloffset=+1]
39+
3840
include::modules/op-starting-pipelines.adoc[leveloffset=+1]
3941

4042
include::modules/op-editing-pipelines.adoc[leveloffset=+1]
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// This module is included in the following assembly:
2+
//
3+
// *openshift-docs/cicd/pipelines/working-with-pipelines-using-the-developer-perspective.adoc
4+
5+
[id='using-custom-pipeline-template-for-git-import']
6+
= Using a custom pipeline template for creating and deploying an application from a Git repository
7+
8+
:context: using-custom-pipeline-template-for-git-import
9+
10+
toc::[]
11+
12+
As a cluster administrator, to create and deploy an application from a Git repository, you can use custom pipeline templates that override the default pipeline templates provided by {pipelines-title} 1.5 and later.
13+
14+
[NOTE]
15+
====
16+
This feature is unavailable in {pipelines-title} 1.4 and earlier versions.
17+
====
18+
19+
.Prerequisites
20+
21+
Ensure that the {pipelines-title} 1.5 or later is installed and available in all namespaces.
22+
23+
.Procedure
24+
25+
. Log in to the {product-title} web console as a cluster administrator.
26+
. In the *Administrator* perspective, use the left navigation panel to go to the _Pipelines_ section.
27+
.. From the *Project* drop-down, select the *openshift* project. This ensures that the subsequent steps are performed in the `openshift` namespace.
28+
.. From the list of available pipelines, select a pipeline that is appropriate for building and deploying your application. For example, if your application requires a `node.js` runtime environment, select the *s2i-nodejs* pipeline.
29+
+
30+
[NOTE]
31+
====
32+
Do not edit the default pipeline template. It may become incompatible with the UI and the back-end.
33+
====
34+
+
35+
.. Under the *YAML* tab of the selected pipeline, click *Download* and save the YAML file to your local machine. If your custom configuration file fails, you can use this copy to restore a working configuration.
36+
37+
. Disable (delete) the default pipeline templates:
38+
.. Use the left navigation panel to go to **Operators** -> **Installed Operators**.
39+
.. Click *{pipelines-title}* -> *Tekton Configuration* tab -> *config* -> *YAML* tab.
40+
.. To disable (delete) the default pipeline templates in the `openshift` namespace, set the `pipelineTemplates` parameter to `false` in the `TektonConfig` custom resource YAML, and save it.
41+
+
42+
[source,yaml]
43+
----
44+
apiVersion: operator.tekton.dev/v1alpha1
45+
kind: TektonConfig
46+
metadata:
47+
name: config
48+
spec:
49+
profile: all
50+
targetNamespace: openshift-pipelines
51+
addon:
52+
params:
53+
- name: clusterTasks
54+
value: "true"
55+
- name: pipelineTemplates
56+
value: "false"
57+
...
58+
----
59+
+
60+
[NOTE]
61+
====
62+
If you manually delete the default pipeline templates, the operator will restore the defaults during an upgrade.
63+
====
64+
+
65+
[WARNING]
66+
====
67+
As a cluster admin, you can disable installation of the default pipeline templates in the operator configuration. However, such a configuration will disable (delete) all default pipeline templates, and not only the one you want to customize.
68+
====
69+
+
70+
71+
. Create a custom pipeline template:
72+
.. Use the left navigation panel to go to the _Pipelines_ section.
73+
.. From the *Create* drop-down, select *Pipeline*.
74+
.. Create the required pipeline in the `openshift` namespace. Give it a different name than the default one (for example, `custom-nodejs`). You can use the downloaded default pipeline template as a starting point and customize it.
75+
+
76+
[NOTE]
77+
====
78+
Because `openshift` is the default namespace used by the operator-installed pipeline templates, you must create the custom pipeline template in the `openshift` namespace. When an application uses a pipeline template, the template is automatically copied to the respective project’s namespace.
79+
====
80+
+
81+
.. Under the *Details* tab of the created pipeline, ensure that the *Labels* in the custom template match the labels in the default pipeline. The custom pipeline template must have the correct labels for the runtime, type, and strategy of the application. For example, the required labels for a `node.js` application deployed on {product-title} are as follows:
82+
+
83+
[source,yaml]
84+
----
85+
...
86+
pipeline.openshift.io/runtime: nodejs
87+
pipeline.openshift.io/type: openshift
88+
...
89+
----
90+
+
91+
[NOTE]
92+
====
93+
You can use only one pipeline template for each combination of runtime environment and deployment type.
94+
====
95+
+
96+
. In the *Developer* perspective, use the *+Add* -> *Git Repository* -> *From Git* option to select the kind of application you want to create and deploy. Based on the required runtime and type of the application, your custom template is automatically selected.

0 commit comments

Comments
 (0)