Skip to content

Commit 06981da

Browse files
authored
Merge pull request #53080 from shipsing/RHDEVDOCS-4711
RHDEVDOCS-4711: Updated the installation procedure for PAC on an Open…
2 parents 53b9040 + 4d159a7 commit 06981da

4 files changed

+27
-70
lines changed

cicd/pipelines/using-pipelines-as-code.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ include::_attributes/common-attributes.adoc[]
77
toc::[]
88

99
:FeatureName: Pipelines as Code
10-
include::snippets/technology-preview.adoc[]
1110

1211
[role="_abstract"]
1312
With {pac}, cluster administrators and users with the required privileges can define pipeline templates as part of source code Git repositories. When triggered by a source code push or a pull request for the configured Git repository, the feature runs the pipeline and reports the status.

modules/op-configuring-pipelines-as-code-for-a-git-repository-hosting-service-provider.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
[role="_abstract"]
1010
After installing {pac}, cluster administrators can configure a Git repository hosting service provider. Currently, the following services are supported:
1111

12-
* Github App
13-
* Github Webhook
12+
* GitHub App
13+
* GitHub Webhook
14+
* GitLab
1415
* Bitbucket Server
1516
* Bitbucket Cloud
1617

modules/op-configuring-pipelines-as-code-for-a-github-app.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ To create and configure a GitHub App manually for {pac}, perform the following s
3333

3434
* **GitHub Application Name**: `OpenShift Pipelines`
3535
* **Homepage URL**: OpenShift Console URL
36-
* **Webhook URL**: The {pac} route or ingress URL. You can find it by executing the command `echo https://$(oc get route -n pipelines-as-code el-pipelines-as-code-interceptor -o jsonpath='{.spec.host}')`.
36+
* **Webhook URL**: The {pac} route or ingress URL. You can find it by running the command `echo https://$(oc get route -n openshift-pipelines pipelines-as-code-controller -o jsonpath='{.spec.host}')`.
3737
+
3838
[NOTE]
3939
====
40-
For {pac} installated by default using the {pipelines-title} Operator, use the `openshift-pipelines` namespace instead of `pipelines-as-code`.
40+
If {pac} is installed without using the {pipelines-title} Operator, use the `pipelines-as-code` namespace instead of `openshift-pipelines`.
4141
====
4242
+
4343
* **Webhook secret**: An arbitrary secret. You can generate a secret by executing the command `openssl rand -hex 20`.
@@ -57,11 +57,9 @@ For {pac} installated by default using the {pipelines-title} Operator, use the `
5757

5858
. Select the following **User permissions**:
5959

60-
* **Commit comment**
60+
* **Check run**
6161
* **Issue comment**
6262
* **Pull request**
63-
* **Pull request review**
64-
* **Pull request review comment**
6563
* **Push**
6664

6765
. Click **Create GitHub App**.
@@ -70,20 +68,22 @@ For {pac} installated by default using the {pipelines-title} Operator, use the `
7068

7169
. In the **Private keys** section, click **Generate Private key** to automatically generate and download a private key for the GitHub app. Securely store the private key for future reference and usage.
7270

71+
. Install the created App on a repository that you want to use with Pipelines as Code.
72+
7373

7474
[id="configuring-pac-for-github-app"]
7575
== Configuring {pac} to access a GitHub App
7676

7777
To configure {pac} to access the newly created GitHub App, execute the following command:
78-
+
78+
7979
[source,terminal]
8080
----
81-
$ oc -n <pipelines-as-code> create secret generic pipelines-as-code-secret \ <1>
81+
$ oc -n openshift-pipelines create secret generic pipelines-as-code-secret \ <1>
8282
--from-literal github-private-key="$(cat <PATH_PRIVATE_KEY>)" \ <2>
8383
--from-literal github-application-id="<APP_ID>" \ <3>
8484
--from-literal webhook.secret="<WEBHOOK_SECRET>" <4>
8585
----
86-
<1> For {pac} installated by default using the {pipelines-title} Operator, use the `openshift-pipelines` namespace instead of `pipelines-as-code`.
86+
<1> If {pac} is installed without using the {pipelines-title} Operator, use the `pipelines-as-code` namespace instead of `openshift-pipelines`.
8787
<2> The path to the private key you downloaded while configuring the GitHub App.
8888
<3> The **App ID** of the GitHub App.
8989
<4> The webhook secret provided when you created the GitHub App.

modules/op-installing-pipelines-as-code-on-an-openshift-cluster.adoc

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,27 @@
77
= Installing {pac} on an {product-title}
88

99
[role="_abstract"]
10-
{pac} is installed by default when you install the {pipelines-title} Operator. If you are using {pipelines-shortname} 1.7 or later versions, skip the procedure for manual installation of {pac}.
10+
{pac} is installed in the `openshift-pipelines` namespace when you install the {pipelines-title} Operator. For more details, see _Installing OpenShift Pipelines_ in the _Additional resources_ section.
1111

12-
However, if you want to disable the default installation of {pac} with the {pipelines-title} Operator, set the value of the `enablePipelinesAsCode` field as `false` in the `TektonConfig` custom resource.
12+
To enable the default installation of {pac} with the {pipelines-title} Operator, set the value of the `enable` parameter to `true` in the `TektonConfig` custom resource:
1313

1414
[source,yaml]
1515
----
1616
...
17-
spec:
18-
addon:
19-
enablePipelinesAsCode: false
17+
spec:
18+
platforms:
19+
openshift:
20+
pipelinesAsCode:
21+
enable: true
22+
settings:
23+
application-name: Pipelines as Code CI
24+
auto-configure-new-github-repo: "false"
25+
bitbucket-cloud-check-source-ip: "true"
26+
hub-catalog-name: tekton
27+
hub-url: https://api.hub.tekton.dev/v1
28+
remote-tasks: "true"
29+
secret-auto-create: "true"
2030
...
2131
----
2232

23-
To install {pac} using the Operator, set the value of the `enablePipelinesAsCode` field to `true`.
24-
25-
[discrete]
26-
.Procedure
27-
28-
. To _manually_ install {pac} on a {product-title} cluster instead of the default installation with the {pipelines-title} Operator, run the following command:
29-
+
30-
[source,terminal]
31-
----
32-
$ VERSION=0.5.4
33-
$ oc apply -f https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-$VERSION/release-$VERSION.yaml
34-
----
35-
+
36-
[NOTE]
37-
====
38-
For the latest stable version, check the link:https://github.com/openshift-pipelines/pipelines-as-code/releases[release page]. In addition, check the {pipelines-title} release notes to ensure that the {pac} version is compatible with the {pipelines-title} version.
39-
====
40-
+
41-
This command installs {pac} in the `pipelines-as-code` namespace and creates user roles and the route URL for the {pac} event listener.
42-
43-
. Note the route URL for the {pac} controller created on the cluster:
44-
+
45-
[source,terminal]
46-
----
47-
$ echo https://$(oc get route -n pipelines-as-code el-pipelines-as-code-interceptor -o jsonpath='{.spec.host}')
48-
----
49-
+
50-
This URL will be needed later when you configure the Git repository hosting service provider.
51-
52-
. (Optional) To allow non-administrative users to create repository custom resource definitions (CRDs) in their respective namespaces, create a `RoleBinding` object with the name `openshift-pipeline-as-code-clusterrole` in the namespace. For example, to allow a user to create a repository CRD in the `user-ci` namespace, run the following command:
53-
+
54-
[source,terminal]
55-
----
56-
$ oc adm policy add-role-to-user openshift-pipeline-as-code-clusterrole user -n user-ci
57-
----
58-
+
59-
Alternatively, apply the following YAML file using the `oc apply -f <RoleBinding.yaml>` command:
60-
+
61-
[source,yaml]
62-
----
63-
apiVersion: rbac.authorization.k8s.io/v1
64-
kind: RoleBinding
65-
metadata:
66-
name: openshift-pipeline-as-code-clusterrole
67-
namespace: user-ci
68-
roleRef:
69-
apiGroup: rbac.authorization.k8s.io
70-
kind: ClusterRole
71-
name: openshift-pipeline-as-code-clusterrole
72-
subjects:
73-
- apiGroup: rbac.authorization.k8s.io
74-
kind: User
75-
name: user
76-
----
33+
If you want to disable the default installation of {pac} with the Operator, set the value of the `enable` parameter to `false`.

0 commit comments

Comments
 (0)