d4x1 commented on code in PR #8611:
URL: 
https://github.com/apache/incubator-devlake/pull/8611#discussion_r2578070440


##########
backend/plugins/webhook/api/deployments.go:
##########
@@ -109,6 +112,96 @@ func PostDeploymentsByName(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceO
        return postDeployments(input, connection, err)
 }
 
+// PostDeploymentsByProjectName
+// @Summary create deployment by project name
+// @Description Create deployment pipeline by project name.<br/>
+// @Description example1: 
{"repo_url":"devlake","commit_sha":"015e3d3b480e417aede5a1293bd61de9b0fd051d","start_time":"2020-01-01T12:00:00+00:00","end_time":"2020-01-01T12:59:59+00:00","environment":"PRODUCTION"}<br/>
+// @Description So we suggest request before task after deployment pipeline 
finish.
+// @Description Both cicd_pipeline and cicd_task will be created
+// @Tags plugins/webhook
+// @Param body body WebhookDeploymentReq true "json body"
+// @Success 200
+// @Failure 400  {string} errcode.Error "Bad Request"
+// @Failure 403  {string} errcode.Error "Forbidden"
+// @Failure 500  {string} errcode.Error "Internal Error"
+// @Router /projects/:projectName/deployments [POST]
+func PostDeploymentsByProjectName(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput, errors.Error) {
+       // find or create the connection for this project
+       connection := &models.WebhookConnection{}
+       projectName := input.Params["projectName"]
+       webhookName := fmt.Sprintf("%s_deployments", projectName)

Review Comment:
   Thanks for your response. It makes sense.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to