@@ -8,17 +8,32 @@ label matching the repo name and are in a namespace matching the branch name.
8
8
If there are no other objects with the given label key in the namespace, it also
9
9
deletes the namespace and all remaining objects.
10
10
11
+ ### PushEvent
12
+ On push events, k8s-webhook-handler will checkout ` .ci/workflow.yaml ` from the
13
+ repo the push was and submit it to the k8s api with the following annotations
14
+ added:
15
+
16
+ - ` k8s-webhook-handler.io/ref ` : event.Ref
17
+ - ` k8s-webhook-handler.io/revision ` : event.HeadCommit.ID
18
+ - ` k8s-webhook-handler.io/repo_name ` : event.Repo.FullName
19
+ - ` k8s-webhook-handler.io/repo_url ` : event.Repo.GitURL
20
+ - ` k8s-webhook-handler.io/repo_ssh ` : event.Repo.SSHURL
21
+
11
22
## Binaries
12
23
- cmd/webhook is the actual webhook handling server
13
24
- cmd/reconciler iterates over all k8s namespaces and deletes all objects that
14
25
are labeled for which there is no remote branch anymore.
15
26
16
27
## Usage
17
28
Currently only github delete webhooks in json format are supported.
18
- Beside the manifests and templates in ` deploy/ ` , a secret 'k8s-ci' with
19
- ` GITHUB_SECRET ` is expected. The value should match the "Secret" field in the
20
- GitHub webhook settings and can be created like this:
29
+ Beside the manifests and templates in ` deploy/ ` , a secret 'webhook-handler' with
30
+ the following fields is expected:
31
+
32
+ - ` GITHUB_TOKEN ` Personal Access Token for API access
33
+ - ` WEBHOOK_SECRET ` Secret for validating the webhook
34
+
35
+ The value should match the "Secret" field in the GitHub webhook settings and can be created like this:
21
36
22
37
```
23
- kubectl create secret generic k8s-ci --from-literal=GITHUB_SECRET=github-secret
38
+ kubectl create secret generic k8s-ci --from-literal=GITHUB_SECRET=github-secret ...
24
39
```
0 commit comments