源码构建镜像CI
Method
POST
描述
持续集成源码构建镜像
请求参数
参数名称 | 说明 | 参数类型 | 是否必填 | 备注 |
Action | BuildImageFromSource | string | 是 | |
Version | 2018-03-08 | string | 是 | |
参数名称 | 说明 | 参数类型 | 是否必填 | 备注 |
RepositoryId | 镜像仓库Id | long | 是 | |
Source | 源代码来源信息 | object | 是 | 详细信息见下表 |
Dockerfile | path | string | 否 | |
NameRule | 镜像版本命名规则,1:updatetime,0:branch+updatetime | integer | 是 | |
Type | Dockerfile类型,1:自动生成,2:自定义 | integer | 是 | |
MetaImageId | 默认dockerfile 使用默认镜像 | long | 否 | |
参数名称 | 说明 | 参数类型 | 是否必填 | 备注 |
CodeFrom | 1:github,2:gitlab | integer | 否 | |
RepoName | 代码仓库名称 | string | 否 | |
RepoId | 源代码仓库id | long | 否 | |
RepoUrl | 代码仓库url | string | 否 | |
Branch | 需要构建镜像的代码分支 | string | 否 | |
CITrigger | 触发构建条件,0:tag,1:branch | integer | 否 | |
返回参数
无返回参数
状态码
错误码(Code) | 错误提示(Message) | http status code | 说明 |
InvalidFormat | The format of the request body is illegal. | 400 | 请求体格式非法 |
MissingParameter | The required input parameter %s for processing this request is not supplied. | 400 | 参数 %s 缺失 |
InvalidParam | The parameter %s can't accept value %s | 400 | 参数%s的值%s非法 |
NotMatchedError | %s is not matched with %s. | 400 | %s和%s不匹配 |
Forbidden | You have no right to access. | 403 | 无权访问 |
OperationNotSupported | %s is not supported. | 400 | %s不被支持 |
ResourceNotFound | %s is not found. | 404 | %s请求的资源不存在 |
OutOfQuota | Your %s quota is up to limit. | 400 | %s配额已满 |
AccountHasBound | %s account has bound. | 400 | %s账号已经绑定 |
OperationFailed | Operation has failed, please try latter. | 400 | 操作失败,请稍后重试 |
请求示例
POST https://open.cn-east-1.163yun.com/ccr?Version=2018-03-08&Action=BuildImageFromSource
{
"RepositoryId":69517,
"Source":{
"CodeFrom":2,
"RepoName":"newprj",
"RepoId":7531358,
"RepoUrl":"https://gitlab.com/test/newprj.git",
"Branch":"master",
"CITrigger":0
},
"Dockerfile":"Dockerfile",
"NameRule":1
}
返回示例
{
"RequestId": "8a722cb1-a7f9-464b-8c2b-72ec8c19f3da"
}