# v2.162.0-Pipeline 支持关联私有部署 Bitbucket 代码仓

更新内容：

1. Pipeline 支持关联私有部署 Bitbucket 代码仓；

### 使用场景

1.使用私有部署 Bitbucket 服务的团队，希望将代码提交与 ONES 内项目管理工作项、迭代关联。

2\. 联合使用部署 Bitbucket 服务+ Jenkins 服务管理的团队，希望将代码提交以及相关流水线运行情况对接到ONES Pipeline。

### 使用流程

新建关联私有部署 Bitbucket 类型代码仓

1. 在 「Pipeline 配置中心」-> 「代码仓管理」中，点击「新建关联代码仓」。

![](/files/-M9xOstRVlW-QvO9-dH6)

2\. 在「新建关联代码仓」弹窗中，选择「私有 Bitbucket」代码仓类型，点击「新建认证」按钮新建私有 Bitbucket 认证。

![](/files/-M9xQ8AR8gsVdmQdTpc5)

3\. 在「认证私有 Bitbucket」弹窗中，填写私有 Bitbucket URL，请根据你的 Bitbucket 服务地址填写。

注意：推荐使用 Bitbucket 6.0或以上版本，低于6.0版本无法保证完全支持。

![](/files/-M9xQg_C3lQLuc3LFWvF)

4\. 选择认证方式。你可以选择「用户名+密码」或者「Token」两种方式进行认证。请确保你填写的用户名或 Token 在Bitbucket 服务中至少具有以下权限：Project 下 Read 权限，Repository 下 Admin 权限。

![](/files/-M9xRxTpDqReAdO4QjJw)

![](/files/-M9xSh2IH8rNb_FVg00s)

5\. 填写完信息后即可提交认证，系统将检查认证是否有效，若有效即认证添加成功。回到「新建关联代码仓」弹窗，可以选择需要添加关联的代码仓。（可选代码仓取决于认证用户可见代码仓）。点击确定后即完成代码仓关联。

![](/files/-M9xTIYpzS9qnGfe36yB)

![](/files/-M9xTh5fpRAar8YMzXI8)

6\. 可对已经关联代码仓进行「移除」、「重置 Webhook」或「手工配置 Webhook」等操作。

![](/files/-M9xU2Nei7xLYyHiywC6)

7\.  在关联的 Bitbucket 代码仓中提交代码，并在 Commit message 中输入包含工作项 ID 的内容，即可将代码提交与 ONES 中的工作项、迭代进行关联。

![](/files/-M9xUvSSh5aWIwxEuJfn)

8\. 如果 Pipeline 关联的 Jenkins 中配置了 Bitbucket 服务，即可在流水线运行中查看流水线运行与代码仓。

![](/files/-M9xVf8z9hanjL5Vme0V)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides-ones.gitbook.io/guides/news/news/v2.162.0pipeline-zhi-chi-guan-lian-si-you-bu-shu-bitbucket-dai-ma-cang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
