You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: automerge-example/README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,6 @@ This example is for more advanced users. Start with the [tekton-example](../tekt
12
12
-[`tkn`](https://github.com/tektoncd/cli) if you're not using webhooks
13
13
-[`docker`](https://docs.docker.com/get-docker/)
14
14
15
-
*Note* The 'standalone' code was developed on Docker Desktop and does not yet include the Role-Based Access Control configuration necessary for it to run on OpenShift or other locked-down environments. The 'webhook' code was developed on OpenShift but used a ServiceAccount that had a generous Role attached to it. Full RBAC support should be added to this example under https://github.com/rhd-gitops-example/services/issues/77.
Create or modify an existing ServiceAccount to use your `github-secret` (hint, you can use the provided `sa.yaml` file: this creates `my-sa` which will be used in the `tkn` command)
60
+
If you did not follow the [tekton-example](../tekton-example/README.md), you will need to create or modify an existing ServiceAccount to use your `github-secret` (You can use the provided `sa.yaml` file - this creates `my-sa` which will be used in the `tkn` command).
61
+
62
+
Once you have a service account, you will need to edit `rbac.yaml` and edit the entries `REPLACE_ME.YOUR_SA_NAME` and `REPLACE_ME.YOUR_NAMESPACE`. Once this is done apply the yaml:
63
+
64
+
```sh
65
+
kubectl apply -f standalone/rbac.yaml
66
+
```
67
+
62
68
63
69
Finally start the Tekton pipeline referencing your ServiceAccount:
64
70
@@ -84,6 +90,7 @@ This secret is used in two related ways. We check the source repository out usin
84
90
```yaml
85
91
---
86
92
apiVersion: v1
93
+
type: kubernetes.io/basic-auth
87
94
data:
88
95
password: [base64-encoded token]
89
96
username: [base64-encoded email address]
@@ -93,15 +100,15 @@ metadata:
93
100
tekton.dev/git-0: https://github.ibm.com # For example
94
101
labels:
95
102
serviceAccount: test-sa # As configured in the Webhooks Extension
96
-
name: github-repo-access-secret
103
+
name: github-secret
97
104
98
105
---
99
106
apiVersion: v1
100
107
kind: ServiceAccount
101
108
metadata:
102
109
name: test-sa
103
110
secrets:
104
-
- name: github-repo-access-secret
111
+
- name: github-secret
105
112
```
106
113
107
114
### Edit templates
@@ -111,7 +118,14 @@ Next edit the `webhooks/templates/*` files.
111
118
- In automerge-task.yaml,
112
119
- replace `YOUR_DOCKER_HUB_ID` with your DockerHub id.
113
120
- replace `YOUR_GHE` with your GitHub Enterprise domain.
114
-
- In automerge-tt.yaml, replace YOUR_TEKTON_SERVICE_ACCOUNT with the name of your ServiceAccount used by Tekton.
121
+
- In automerge-tt.yaml,
122
+
- replace `YOUR_TEKTON_SERVICE_ACCOUNT` with the name of your ServiceAccount used by Tekton.
123
+
- In automerge-tb.yaml,
124
+
- replace `YOUR-GIT-USER-NAME` with your GitHub user name
125
+
- replace `YOUR-GIT-EMAIL` with the associated email address
126
+
- In rbac.yaml,
127
+
- replace `YOUR_TEKTON_SERVICE_ACCOUNT` as per earlier
128
+
- replace `YOUR_NAMESPACE` with the namespace of your serviceaccount
0 commit comments