全部产品
Search
文档中心

资源编排:ALIYUN::DEVOPS::PipelineRun

更新时间:Aug 12, 2024

ALIYUN::DEVOPS::PipelineRun类型用于运行流水线。

语法

{
  "Type": "ALIYUN::DEVOPS::PipelineRun",
  "Properties": {
    "PipelineId": Number,
    "Params": Map,
    "OrganizationId": String,
    "Sync": Boolean,
    "Timeout": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

PipelineId

Number

流水线ID。

可在流水线链接中获取。例如https://flow.aliyun.com/pipelines/【PipelineId】/current 5ebbc0228123212b59xxxxx

Params

Map

流水线运行参数。

取值:

  • branchModeBranchs:分支模式运行分支。

  • envs:运行变量。  

  • runningBranchs:运行分支key为仓库地址。 

  • runningTags:运行tag key为仓库地址。 

示例:

{
  "branchModeBranchs": [
    "branch1",
    "branch2"
  ],
  "envs": {
    "k1": "v1",
    "k2": "v2",
    "k3": "v3"
  },
  "runningBranchs": {
    "https://codeup.aliyun.com/60c1abb32c5969c370c5****/Codeup-Demo.git": "master1"
  },
  "runningTags": {
    "https://codeup.aliyun.com/60c1abb32c5969c370c5****/Codeup-Demo.git": "1.0"
  }
}

OrganizationId

String

企业标识,也称企业ID。

字符串形式,可在云效访问链接中获取。例如:https://devops.aliyun.com/organization/【OrganizationId】

Sync

Boolean

是否同步等待管道执行的结果。  

取值:

  • true:同步等待管道执行的结果。

    当您取值为true时,在流水线完成之前不会创建资源。

  • false(默认值):异步等待管道执行的结果。

说明

当流水线配置了暂停策略时,不要将此选项设置为true,因为发布需要手动干预,并且不合适同步。

Timeout

Integer

流水线执行的最大等待时间。

单位:分钟。

当Sync设置为true时,需要配置此参数。 

默认值:10 。

返回值

Fn::GetAtt

PipelineRunId:流水线运行实例ID

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      OrganizationId:
        Description:
          en: Corporate identity, also known as enterprise id, can obtain in cloud effect
            access links.
        Type: String
      Params:
        Description:
          en: 'Pipeline operating parameters. Keys:
    
            - **branchModeBranchs**: Branch mode runs branches.
    
            - **envs**: Running variables.
    
            - **runningBranchs**: Running branches whose key is the warehouse address.
    
            - **runningTags**: Running tags whose key is the warehouse address.'
        Type: Json
      PipelineId:
        Description:
          en: The pipeline ID, which can be obtained from the pipeline link.
        Type: Number
    Resources:
      PipelineRun:
        Properties:
          OrganizationId:
            Ref: OrganizationId
          Params:
            Ref: Params
          PipelineId:
            Ref: PipelineId
        Type: ALIYUN::DEVOPS::PipelineRun
    Outputs:
      PipelineRunId:
        Description: Pipeline run id.
        Value:
          Fn::GetAtt:
          - PipelineRun
          - PipelineRunId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "PipelineId": {
          "Type": "Number",
          "Description": {
            "en": "The pipeline ID, which can be obtained from the pipeline link."
          }
        },
        "Params": {
          "Type": "Json",
          "Description": {
            "en": "Pipeline operating parameters. Keys:\n- **branchModeBranchs**: Branch mode runs branches.\n- **envs**: Running variables.\n- **runningBranchs**: Running branches whose key is the warehouse address.\n- **runningTags**: Running tags whose key is the warehouse address."
          }
        },
        "OrganizationId": {
          "Type": "String",
          "Description": {
            "en": "Corporate identity, also known as enterprise id, can obtain in cloud effect access links."
          }
        }
      },
      "Resources": {
        "PipelineRun": {
          "Type": "ALIYUN::DEVOPS::PipelineRun",
          "Properties": {
            "PipelineId": {
              "Ref": "PipelineId"
            },
            "Params": {
              "Ref": "Params"
            },
            "OrganizationId": {
              "Ref": "OrganizationId"
            }
          }
        }
      },
      "Outputs": {
        "PipelineRunId": {
          "Description": "Pipeline run id.",
          "Value": {
            "Fn::GetAtt": [
              "PipelineRun",
              "PipelineRunId"
            ]
          }
        }
      }
    }