Build

开始一个构建。Start a build.

触发一次新的流水线构建,支持通过 body 参数指定分支、提交和构建变量。 Trigger a new pipeline build. Branch, commit, and build variables can be specified via body parameters. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-cnb-trigger:rw

post/{repo}/-/build/start

Request

  • Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
  • URL: https://api.cnb.cool/{repo}/-/build/start
  • Auth: API key in header Authorization

Path parameters

repostring required

仓库。Repo.

Request body

branchstring

触发分支,默认为主分支。Trigger branch, defaults to main branch.

configstring

指定配置文件内容,yaml 格式。Config file content in YAML format.

envobject

环境变量,对象格式。Environment variables in object format.

eventstring

事件名,须为 api_trigger 或以它开头。Event name; must be api_trigger or its prefix.

shastring

commit id ,优先级比 tag 高,默认为分支最新提交记录。Commit ID, higher priority than tag, defaults to the latest commit of the branch.

syncstring

是否等待构建触发,false 立即返回 sn 和 url。Whether to wait; false returns sn and buildLogUrl now.

tagstring

触发 tag,优先级比 branch 高。Trigger tag, higher priority than branch.

titlestring

构建标题。Build title.

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.