This is an automated email from the ASF dual-hosted git repository.

zky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git


The following commit(s) were added to refs/heads/main by this push:
     new d469a51cf6 docs: update webhook connection (#683)
d469a51cf6 is described below

commit d469a51cf69545523e62172f7571b1dab55474d4
Author: abeizn <[email protected]>
AuthorDate: Mon Dec 4 19:20:28 2023 +0800

    docs: update webhook connection (#683)
    
    * docs: update webhook connection
    
    * docs: add webhook-connection png
    
    * docs: improve the docs
    
    * fix: image link
---
 docs/Configuration/images/webhook-connection1.png  | Bin 0 -> 92931 bytes
 docs/Configuration/images/webhook-connection2.png  | Bin 0 -> 104010 bytes
 docs/Configuration/webhook.md                      |   6 +-
 docs/Plugins/webhook.md                            |  62 +++++++++++++++++----
 .../img/ConfigUI/webhook-add-data-connections.png  | Bin 22397 -> 19602 bytes
 5 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/docs/Configuration/images/webhook-connection1.png 
b/docs/Configuration/images/webhook-connection1.png
new file mode 100644
index 0000000000..cb0d8951b8
Binary files /dev/null and b/docs/Configuration/images/webhook-connection1.png 
differ
diff --git a/docs/Configuration/images/webhook-connection2.png 
b/docs/Configuration/images/webhook-connection2.png
new file mode 100644
index 0000000000..d6d5fddffc
Binary files /dev/null and b/docs/Configuration/images/webhook-connection2.png 
differ
diff --git a/docs/Configuration/webhook.md b/docs/Configuration/webhook.md
index 7fa721067e..40392e802d 100644
--- a/docs/Configuration/webhook.md
+++ b/docs/Configuration/webhook.md
@@ -16,9 +16,11 @@ We recommend that you give your webhook connection a unique 
name so that you can
 
 ### Step 2 - Create webhooks connection
 
-Click on Generate POST URL, and you will find three webhook URLs. Copy the 
ones that suit your usage into your CI or issue-tracking systems. You can 
always come back to the webhook page to copy the URLs later on.
+Click on Generate POST URL, and you will find three webhook URLs. 
+![webhook-connection1](images/webhook-connection1.png)
 
-![webhook-connection](/img/ConfigUI/webhook-connection.png)
+Revoke and generate a new key. Copy the ones that suit your usage into your 
CI/CD or issue-tracking systems. You can always come back to the webhook page 
to copy the URLs later on.
+![webhook-connection2](images/webhook-connection2.png)
 
 ### Step 3 - Use webhook in a project
 
diff --git a/docs/Plugins/webhook.md b/docs/Plugins/webhook.md
index a92dba9c3d..328223d2a6 100644
--- a/docs/Plugins/webhook.md
+++ b/docs/Plugins/webhook.md
@@ -45,31 +45,37 @@ If you want to collect deployment data from your system, 
you can use the incomin
 
 You can copy the generated deployment curl commands to your CI/CD script to 
post deployments to Apache DevLake. Below is the detailed payload schema:
 
-|     Key     | Required | Notes                                               
                                                                                
                                             |
-| :---------: | :------: | 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 |
+|     Key     | Required | Notes                                               
                                                                                
                                            |
+| :---------: | :------: | 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 |
 | pipeline_id |  ✖️ No   | related Domain Layer `cicd_pipelines.id`            
                                                                                
                                             |
-| environment |  ✖️ No   | the environment this deployment happens. For 
example, `PRODUCTION` `STAGING` `TESTING` `DEVELOPMENT`. <br/>The default value 
is `PRODUCTION`                                     |
+| environment |  ✖️ No   | the environment this deployment happens. For 
example, `PRODUCTION` `STAGING` `TESTING` `DEVELOPMENT`. <br/>The default value 
is `PRODUCTION`                  |
 |  repo_url   |  ✔️ Yes  | the repo URL of the deployment commit<br />If there 
is a row in the domain layer table `repos` where `repos.url` equals `repo_url`, 
the `repoId` will be filled with `repos.id`. |
 |   repo_id   |  ✖️ No   | related Domain Layer `repos.id` <br/> No default 
value.                                                                          
                                                |
-|  ref_name   |  ✖️ No   | related branch/tag<br/> No default value.           
                                                                                
                                             |
-| commit_sha  |  ✔️ Yes  | the sha of the deployment commit                    
                                                                                
                                             |
+|    name     |  ✖️ No   | deployment name. The default value is "deployment 
for `request.commit_sha`"                                                       
                            |
+|  ref_name   |  ✖️ No   | related branch/tag<br/> No default value.           
                                                                                
                          |
+| commit_sha  |  ✔️ Yes  | the sha of the deployment commit                    
                                                                                
                          |
+| commit_msg  |  ✖️ No   | the sha of the deployment commit message            
                                                                                
                          |
 | create_time |  ✖️ No   | Time. Eg. 2020-01-01T12:00:00+00:00<br/> No default 
value.                                                                          
                                             |
-| start_time  |  ✔️ Yes  | Time. Eg. 2020-01-01T12:00:00+00:00<br/> No default 
value.                                                                          
                                             |
-|  end_time   |  ✔️ Yes  | Time. Eg. 2020-01-01T12:00:00+00:00<br/> The 
default value is the time when DevLake receives the POST request.               
                                                    |
+| start_time  |  ✔️ Yes  | Time. Eg. 2020-01-01T12:00:00+00:00<br/> No default 
value.                                                                          
                          |
+|  end_time   |  ✖️ No   | Time. Eg. 2020-01-01T12:00:00+00:00<br/> The 
default value is the time when DevLake receives the POST request.               
                                                    |
 |   result    |  ✖️ No   | deployment result, one of the values : `SUCCESS`, 
`FAILURE`, `ABORT`, `MANUAL`, <br/> The default value is `SUCCESS`.             
                                               |
+| deploymentCommits[]    |  ✖️ yes  | Allow deployment webhook to push 
deployments to multiple repos in one request, includes 
repo_url,commit_sha,commit_msg,name,ref_name    |
+
 
-#### Register a Deployment - Sample API Calls
 
-Sample CURL to post deployments to DevLake. The following command should be 
replaced with the actual curl command copied from your Config UI:
+#### Register a Deployment - Sample API Calls
 
+To deploy on a single repository, use the following command:
 ```
 curl <devlake-host>/api/rest/plugins/webhook/1/deployments -X 'POST' -d '{
     "pipeline_id": "optional-pipeline-id",
     "environment":"PRODUCTION",
     "repo_url":"https://github.com/apache/incubator-devlake/";,
     "repo_id": "optional-repo-id",
+    "name": "optional-deployment-name. If you do not post a name, DevLake will 
generate one for you.",
     "ref_name": "optional-release-v0.17",
     "commit_sha":"015e3d3b480e417aede5a1293bd61de9b0fd051d",
+    "commit_msg":"optional-commit-message",
     "create_time":"2020-01-01T11:00:00+00:00",
     "start_time":"2020-01-01T12:00:00+00:00",
     "end_time":"2020-01-02T13:00:00+00:00",
@@ -77,12 +83,46 @@ curl <devlake-host>/api/rest/plugins/webhook/1/deployments 
-X 'POST' -d '{
   }'
 ```
 
+To deploy across multiple repositories (refer to the 
[discussion](https://github.com/apache/incubator-devlake/discussions/6162)), 
use the following command:
+```
+curl <devlake-host>/api/rest/plugins/webhook/1/deployments -X 'POST' -d '{
+    "pipeline_id": "optional-pipeline-id",
+    "environment":"PRODUCTION",
+    "repo_id": "optional-repo-id",
+    "name": "optional-deployment-name. If you do not post a name, DevLake will 
generate one for you.",
+    "create_time":"2020-01-01T11:00:00+00:00",
+    "start_time":"2020-01-01T12:00:00+00:00",
+    "end_time":"2020-01-02T13:00:00+00:00",
+    "result": "FAILURE",
+    "deploymentCommits":[
+       {
+           "repo_url":"repo-1",
+           "name":"optional, if null, it will be deployment for {commit_sha}",
+           "ref_name": "optional-release-v0.17",
+           "commit_sha":"c1",
+           "commit_msg":"optional-msg-1"
+       },
+       {
+           "repo_url":"repo-2",
+           "name":"optional, if null, it will be deployment for {commit_sha}",
+           "ref_name": "optional-release-v0.17",
+           "commit_sha":"c2",
+           "commit_msg":"optional-msg-2"
+       }
+    ]
+  }'
+```
+
 If you have set a [username/password](GettingStarted/Authentication.md) for 
Config UI, you'll need to add them to the curl command to register a 
`deployment`:
 
 ```
 curl <devlake-host>/api/rest/plugins/webhook/1/deployments -X 'POST' -u 
'username:password' -d '{
-    "commit_sha":"015e3d3b480e417aede5a1293bd61de9b0fd051d",
-    "repo_url":"https://github.com/apache/incubator-devlake/";,
+    "deploymentCommits":[
+        {
+        "commit_sha":"the sha of deployment commit1",
+        "repo_url":"the repo URL of the deployment commit"
+        }
+    ],
     "start_time":"2020-01-01T12:00:00+00:00",
     "end_time":"2020-01-02T12:00:00+00:00"
   }'
diff --git a/static/img/ConfigUI/webhook-add-data-connections.png 
b/static/img/ConfigUI/webhook-add-data-connections.png
index 4b1b050893..2000f04de7 100644
Binary files a/static/img/ConfigUI/webhook-add-data-connections.png and 
b/static/img/ConfigUI/webhook-add-data-connections.png differ

Reply via email to