源码构建镜像CI

Method

POST

描述

持续集成源码构建镜像

请求参数

参数名称说明参数类型是否必填备注
ActionBuildImageFromSourcestring
Version2018-03-08string
参数名称说明参数类型是否必填备注
RepositoryId镜像仓库Idlong
Source源代码来源信息object详细信息见下表
Dockerfilepathstring
NameRule镜像版本命名规则,1:updatetime,0:branch+updatetimeinteger
TypeDockerfile类型,1:自动生成,2:自定义integer
MetaImageId默认dockerfile 使用默认镜像long
参数名称说明参数类型是否必填备注
CodeFrom1:github,2:gitlabinteger
RepoName代码仓库名称string
RepoId源代码仓库idlong
RepoUrl代码仓库urlstring
Branch需要构建镜像的代码分支string
CITrigger触发构建条件,0:tag,1:branchinteger

返回参数

无返回参数

状态码

错误码(Code)错误提示(Message)http status code说明
InvalidFormatThe format of the request body is illegal.400请求体格式非法
MissingParameterThe required input parameter %s for processing this request is not supplied.400参数 %s 缺失
InvalidParamThe parameter %s can't accept value %s400参数%s的值%s非法
NotMatchedError%s is not matched with %s.400%s和%s不匹配
ForbiddenYou have no right to access.403无权访问
OperationNotSupported%s is not supported.400%s不被支持
ResourceNotFound%s is not found.404%s请求的资源不存在
OutOfQuotaYour %s quota is up to limit.400%s配额已满
AccountHasBound%s account has bound.400%s账号已经绑定
OperationFailedOperation 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"
}