GitHub user mieliespoor added a comment to the discussion: Multiple projects, 
same webhook integration

In our case, we can simply add the project name to the body of the post 
request. We have a 1-1 relationship between the repository and the deployment 
project, and as a result, also a 1-1 to devlake. As a result, we could simply 
do a webhook post similar to this;

```bash
curl 
https://apache-devlake.internal.endpoint/api/rest/plugins/webhook/connections/1/deployments
 -X 'POST' -H 'Authorization: Bearer ' -d '{
      "id": "Required. This will be the unique ID of the deployment",
      "projectName": "devlake-project-name",
      "startedDate": "2023-01-01T12:00:00+00:00",
      "finishedDate": "2023-01-01T12:00:00+00:00",
      "result": "SUCCESS",
      "deploymentCommits":[
        {
          "repoUrl": "your-git-url",
          "refName": "your-branch-name",
          "startedDate": "2023-01-01T12:00:00+00:00",
          "finishedDate": "2023-01-01T12:00:00+00:00",
          "commitSha": "e.g. 015e3d3b480e417aede5a1293bd61de9b0fd051d",
          "commitMsg": "optional-commit-message"
        }
      ]
    }'
```

Our deployment tool is Octopus Deploy. Ideally it will be supported by DevLake 
in the future, but until then, webhooks is the only way to go.

GitHub link: 
https://github.com/apache/incubator-devlake/discussions/6348#discussioncomment-14193740

----
This is an automatically sent email for dev@devlake.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@devlake.apache.org

Reply via email to