update s2i trigger details

Signed-off-by: zhuxiaoyang <sunzhu@yunify.com>
This commit is contained in:
zhuxiaoyang 2020-04-02 17:51:36 +08:00
parent 43736bde71
commit e746ae9e06
No known key found for this signature in database
GPG Key ID: F2782B7F5216D1E9

View File

@ -8,17 +8,17 @@
Currently, only GitHub-webhook and General-webhook are supported. GitHub-webhook handler can handle push events from the GitHub webhook server, and other event types will be ignored. General-webhook handler can handle any request from any server, Whether the method is Get or Post, after receiving the request, it will create s2iRun CR resource automatically, and then S2I-Operator will create a job to clone and build the program.
Currently, only GitHub-webhook and General-webhook are supported. GitHub-webhook handler can handle push events from the GitHub webhook server, and extract the commitId, author and other information from the webhook payload, so the operation will be more accurate. General-webhook handler can receive any SCM webhook or other customize server theoretically, Whether the method is Get or Post, but there may be some meaningless auto-runs because the webhook payload cannot be parsed. General-webhook handler use `secretCode` that in URL query paramters for authentication, `secretCode` must match the data with field secretCode from CR s2iBuilder. After receiving the request and authentication success, it will create s2iRun CR resource automatically, and then S2I-Operator will create a job to clone and build the program. Therefore, the user should select the correct webhook type when configuring the webhook.
**Below is the URL defined for s2i trigger:**
*GitHub-webhook:*
`http://endpoint/s2itrigger/v1alpha1/github/namespaces/{mamespace}/s2ibuilders/{s2ibuilderName}`
`http://endpoint/s2itrigger/v1alpha1/github/namespaces/{namespace}/s2ibuilders/{s2ibuilderName}?secretCode={secretCode}`
*General-webhook:*
`http://endpoint/s2itrigger/v1alpha1/general/namespaces/{mamespace}/s2ibuilders/{s2ibuilderName}`
`http://endpoint/s2itrigger/v1alpha1/general/namespaces/{namespace}/s2ibuilders/{s2ibuilderName}`
In the future, we will provide more types of webhook handlers.