子パイプライン ステップのオプション

子パイプラインでは、パイプライン内で別のパイプラインをトリガーするステップを定義できます。これにより、より複雑なワークフローをモジュール化して効率化し、パイプライン内での並列処理を向上させることができます。「パイプライン ステップ内のパイプライン」を定義するには、次のオプションを使用します。子パイプライン (パイプライン内のパイプライン) ステップでは type: pipeline を使用します。

custom プロパティ

custom オプションは、子パイプライン ステップの実行時に実行されるカスタム パイプラインを定義するために使用されます。

プロパティstep

必須 — はい (type: pipeline の場合)

データ タイプ — 文字列 (カスタム パイプラインの名前と一致する必要がある)

指定可能な親プロパティstep

指定可能な子プロパティ — なし


input-variables プロパティ

input-variables プロパティは、親パイプラインから子パイプラインに渡すことができる変数を定義するために使用します。渡された変数は子パイプラインのパイプライン変数と見なされます。

pipeline ステップの入力変数は 20 個までに制限されています。

プロパティinput-variables

必須 — いいえ

Data type — Key-value pair (YAML spec - Block Mappings)

指定可能な値 — 有効な変数名

  • 名前には ASCII 文字、数字、およびアンダースコアのみを含めることができます。

  • 名前の先頭を数字にすることはできません。

指定可能な親プロパティ — step

例: input-variables オプションを使用して、子パイプラインに公開できる変数を定義します。

pipelines: custom: a-parent-pipeline: - variables: - name: parent_pipeline_variable default: "val1" allowed-values: - "val1" - "val2" - step: name: 'Child pipeline' type: pipeline custom: a-child-pipeline input-variables: var_1: $parent_pipeline_variable var_2: $repository_variable_name var_3: $workspace_variable_name var_4: "static-value-1" var_5: "static-value-2" a-child-pipeline: - step: name: 'Child Pipeline step' script: - echo "Parent Pipeline Step Variable -" $var_1 - echo "Parent Pipeline Step Variable -" $var_2

The artifacts property

The artifacts property is used to share uploaded artifacts from a parent pipeline into child pipelines, or from a child pipeline out to its parent. Artifacts shared into a child pipeline are available for download in all steps of the child pipeline, while artifacts shared out to the parent are available in all steps after the child pipeline step.

For details on using artifacts, see using artifacts in steps.

Example: Using the artifacts option to share a file in and out of a child pipeline:

pipelines: custom: parent-pipeline: - step: name: 'Message in a Bottle' script: - echo "Important Message!" > bottle.log artifacts: upload: - name: Bottle paths: - bottle.log - step: name: 'Child Pipeline Calling Step' type: pipeline custom: child-pipeline artifacts: upload: - Bottle download: - Bottle - step: name: 'Final Update' script: - echo "P.P.S. I'm serious, it's urgent!" >> bottle.log artifacts: upload: - name: Bottle paths: - bottle.log - step: name: 'Read Final Message' script: - cat bottle.log child-pipeline: - step: name: 'Step in Child Pipeline' script: - echo "P.S. It's time-sensitive as well." >> bottle.log artifacts: upload: - name: Bottle paths: - bottle.log

プロパティartifacts

必須 — いいえ

Data type — Block of new-line separated key-value pairs (YAML spec - Block Mappings)

Allowed parent propertiesstep

Allowed child propertiesupload and download

Upload Artifacts

The artifact upload property is used to list the paths or names of artifacts to share from the parent pipeline into the child pipeline.

There is a limit of 20 upload artifacts in a child-pipeline step.

プロパティupload

必須 — いいえ

Data type — A list of strings (YAML spec - Sequence)

Allowed parent propertiesartifacts

Download Artifacts

The artifact download property is used to list the paths or names of artifacts to share from the child pipeline out to the parent pipeline.

There is a limit of 20 download artifacts in a child-pipeline step.

プロパティdownload

必須 — いいえ

Data type — A list of strings (YAML spec - Sequence)

Allowed parent propertiesartifacts


script プロパティ

script プロパティは実行されないため、子パイプライン ステップには含めないでください。代わりに、custom プロパティによって参照される子パイプラインのステップが実行されます。


制限されているプロパティ

Child pipeline steps are just a trigger to execute a separate pipeline within a pipeline. For instance, defining the image on a child pipeline step is invalid, as it is not run directly in a step environment but triggers the execution of a seperate pipeline.

The following properties are not supported by pipeline steps and should not be included when using type: pipeline. The properties listed below should be used inside the child pipeline itself instead, with the exclusion of deployment, which is not supported in child pipelines,

  • deployment - not supported in pipeline or child pipeline steps

  • Stage

  • size

  • ランタイム

  • output-variables

  • Cache

  • runs-on

  • image

  • clone

  • oidc

  • services

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。