This is an automated email from the ASF dual-hosted git repository. hez pushed a commit to branch add-bitbucket-doc-draft in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git
commit e0bad8f266ac81caef38f6e0163fa95345b50129 Author: Hezheng Yin <[email protected]> AuthorDate: Thu Oct 27 22:47:30 2022 -0700 docs: add doc for invoking Bitbucket plugin through API --- docs/Plugins/bitbucket.md | 77 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/docs/Plugins/bitbucket.md b/docs/Plugins/bitbucket.md new file mode 100644 index 000000000..ffdb7b01c --- /dev/null +++ b/docs/Plugins/bitbucket.md @@ -0,0 +1,77 @@ +--- +title: "GitHub" +description: > + GitHub Plugin +--- + + + +## Summary + +This plugin collects various entities from Bitbucket, including pull requests, issues, comments, pipelines, git commits, and etc. + +As of v0.14.2, `bitbucket` plugin can only be invoked through DevLake API. Its support in Config-UI is WIP. + + +## Usage via DevLake API + +> Note: Please replace the `http://localhost:8080` in the sample requests with your actual DevLake API endpoint. For how to view DevLake API's swagger documentation, please refer to the "Using DevLake API" section of [Developer Setup](../../DeveloperManuals/DeveloperSetup.md). + + +1. Create a Bitbucket data connection: `POST /plugins/bitbucket/connections`. Please see a sample request below: + +``` +curl --location --request POST 'http://localhost:8080/plugins/bitbucket/connections' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "endpoint": "https://api.bitbucket.org/2.0/", + "username": "<your username>", + "password": "<your app password>", + "name": "Bitbucket Cloud" +}' +``` + +2. Create a blueprint to collect data from Bitbucket: `POST /blueprints`. Please see a sample request below: + +``` +curl --location --request POST 'http://localhost:8080/blueprints' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "enabled": true, + "mode": "NORMAL", + "name": "My Bitbucket Blueprint", + "cronConfig": "<cron string of your choice>", + "isManual": false, + "plan": [[]], + "settings": { + "connections": [ + { + "plugin": "bitbucket", + "connectionId": 1, + "scope": [ + { + "entities": [ + "CODE", + "TICKET", + "CODEREVIEW", + "CROSS" + ], + "options": { + "owner": "<owner of your repo>", + "repo": "<your repo name>" + } + } + ] + } + ], + "version": "1.0.0" + } +}' +``` + +3. [Optional] Trigger the blueprint manually: `POST /blueprints/{blueprintId}/trigger`. Run this step if you want to trigger the newly created blueprint right away. See an example request below: + +``` +curl --location --request POST 'http://localhost:8080/blueprints/<blueprintId>/trigger' \ +--header 'Content-Type: application/json' +```
