更新时间:2026-03-20 GMT+08:00
分享

配置流水线源

通过使用sources字段,可以指定流水线的源。在同一条流水线中,可以配置多个源。详情请参考表1

表1 流水线源类型

源类型

仓库类型

配置属性

代码源

codehub

codehub_id:代码仓库id。

repo_project_id:代码源为“其他项目Repo”时,所填写的项目id。

github

endpoint_id:扩展点id,获取方式请参考管理服务扩展点

general_git:通用git。

gitlab

gitee:码云。

gerrit

tfs_git:TFS。

gitcode

custom_gitlab:自建GitLab。

bitbucket

endpoint_id:扩展点id。

workspace_id:bitbucket上的项目空间id。

产物源

artifact_generic:软件发布库。

version_type:产物源默认版本策略。specific:指定版本;latest:最新版本。

version:当version_type配置为specific时,需配置版本号。

name:产物包名。

directory:产物包所在目录。

artifact_docker:Docker库。

version_type:产物源默认版本策略。specific:指定版本;latest:最新版本。

version:当version_type配置为specific时,需配置版本号。

org:镜像所属组织。

image:镜像地址。

artifact_swr:SWR源。

version:版本号

organization:所属组织。

name:产物名称。

path:产物路径。

YAML文件示例

sources:
  phonix_sample:                                          #界面上别名
    type: codehub                                         #仓库/制品类型
    name: phineoxsample                                   #代码源名称
    branch: master                                        #默认分支
    git_url: https://test/test/phineoxsample.git          #仓库http地址
    ssh_git_url: git@test:test/phineoxsample.git          #仓库ssh地址
    codehub_id: 123
  test_bit:                                               #界面上别名,源唯一标识
    type: bitbucket                                       #git仓库类型 
    name: test_bit                                        #代码源名称
    branch: master                                        #默认分支
    git_url: https://test/test/test_bit.git               #仓库http地址
    ssh_git_url: git@test:test/test_bit.git               #仓库ssh地址
    endpoint_id: test                                     #扩展点id
    workspace_id: xxx
  artigen_source1:                                        #别名,源唯一标识
    type: artifact_generic                                #产物类型
    version_type: specific                                #产物源默认版本策略
    version: 1.0.0                                        #当version_type为specific时,需配置版本号
    directory: xxx                                        #产物包所在目录
    name: test                                            #产物包名
  swr_javadocer:                                          #别名,源唯一标识
    type: artifact_docker                                 #产物类型
    org: dev_x                                            #组织名 
    image: java                                           #镜像名
    version_type: specific                                #产物源默认版本策略
    version: test                                         #当version_type为specific时,需配置版本号
  _devcloud_devcloud_demo:                                #别名,源唯一标识
    type: artifact_swr
    organization: org                                     #组织
    name: demo                                            #镜像名
    version: v1.1                                         #指定版本
    path: swr.cn-north-7.example.com/org/demo:v1.1
表2 参数解释

参数名

是否必填

说明

phonix_sample

流水线源的唯一标识,仅支持大小写英文字母、数字、下划线,长度不超过128个字符。

type

仓库类型。当前支持的仓库类型有codehub、github、general_git、gitlab、gitee、gerrit、tfs_git、gitcode、custom_gitlab、bitbucket。

name

代码源名称。

branch

默认分支,若启动时未指定分支,则使用默认分支执行。

git_url

仓库http地址,例如https://test/test/phineoxsample.git。

ssh_git_url

仓库ssh地址,例如git@test:test/phineoxsample.git。

codehub_id

仓库id。

endpoint_id

扩展点id,非codehub源时必填,需提供扩展点,用以访问配置的仓库。

workspace_id

仓库类型为bitbucket时,必填,bitbucket上的项目空间id。

version_type

产物类型为artifact_generic时,产物源默认的版本策略。

  • specific:指定版本。
  • latest:最新版本。

version

产物类型为artifact_generic,version_type配置为specific时,需配置版本号。

directory

产物类型为artifact_generic。version_type配置为specific时,产物包所在目录。

name

产物类型为artifact_generic,version_type配置为specific时,产物包名。

org

产物类型为artifact_docker时,镜像所属组织名。

image

产物类型为artifact_docker时,镜像名。

version_type

产物类型为artifact_docker时,产物源默认的版本策略。

  • specific:指定版本。
  • latest:最新版本。

version

产物类型为artifact_docker,version_type配置为specific时,需配置版本号。

organization

产物类型为artifact_swr时,选择的SWR组织。

name

产物类型为artifact_swr时,SWR组织下的镜像。

version

产物类型为artifact_swr时,镜像的版本。

path

产物类型为artifact_swr时,镜像的地址。

相关文档