All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DEVOPS::PipelineRun

Last Updated:Aug 12, 2024

ALIYUN::DEVOPS::PipelineRun is used to run a pipeline.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

PipelineId

Number

Yes

No

The pipeline ID.

You can obtain the pipeline ID from the pipeline URL. Sample URL: https://flow.aliyun.com/pipelines/[PipelineId]/current 5ebbc0228123212b59xxxxx.

Params

Map

No

No

The parameters that are used to run the pipeline.

Valid values:

  • branchModeBranchs: the running branches when the pipeline runs in branch mode.

  • envs: the variables that are used to run the pipeline.  

  • runningBranchs: the running branches whose keys are repository addresses.  

  • runningTags: the running tags whose keys are repository addresses.  

Example:

{
  "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

Yes

No

The ID of the organization workspace.

The value is of the String type. You can obtain the ID of the organization workspace from the URL of Apsara Devops. Sample URL: https://devops.aliyun.com/organization/[OrganizationId].

Sync

Boolean

No

No

Specifies whether to synchronously wait for the running result of the pipeline.   

Valid values:

  • true: synchronously waits for the running result of the pipeline.

    If you set the value to true, the system does not create resources until the pipeline is run.

  • false (default): asynchronously waits for the running result of the pipeline.

Note

If the pipeline is configured with a suspension policy, we recommend that you do not set the value to true. This is because the release process requires manual operations and is not suitable for synchronization.

Timeout

Integer

No

No

The maximum timeout period for running the pipeline.

Unit: minutes.

You must specify this property when Sync is set to true.  

Default value: 10.

Return values

Fn::GetAtt

PipelineRunId: the ID of the instance that runs the pipeline.

Examples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }