TriggerPipeline - Examples

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

The following examples show how to configure a TriggerPipeline step. For more information on TriggerPipeline Pipeline steps, see TriggerPipeline.

These examples require a JFrog Platform Access Token integration.

Example 1
pipelines:
  - name: top_pipeline
    steps:
      - name: scan_controller
        type: TriggerPipeline
        configuration:
          pipelineName: scanner_pipeline
          stepName: scan_it
          waitForRunCompletion: true
          integrations:
            - name: myPlatformToken
          environmentVariables:
            scan_target:
              default: "hello-world"
              allowCustom: true
              values:
                - "vault"
                - "redis"
                - "postgresql"
                - "hello-world"
        execution:
          onStart:
            - set_trigger_payload pipelineVariables "scan_target=${scan_target}"
            - set_trigger_payload stepVariables "notify=email" "uploadReport=true"
          onComplete:
            - echo "Final status is $nested_run_status"

  - name: scanner_pipeline
    steps:
      - name: scan_it
        type: Bash
        execution:
          onExecute:
            - echo "Image to scan is $scan_target."
            - echo "Triggered by parent step at $parent_step_url"

Example 2
resources:
  - name: propertyBag_e
    type: PropertyBag
    configuration:
      foo: bar
  - name: propertyBag1_e
    type: PropertyBag
    configuration:
      foo1: bar1
  - name: propertyBag2
    type: PropertyBag
    configuration:
      foo2: bar2
  - name: propertyBag3
    type: PropertyBag
    configuration:
      foo3: bar3

pipelines:
  - name: pipeline1
    steps:
      - name: first_step
        type: TriggerPipeline  
        configuration:
          pipelineName:   pipeline2
          stepName:       first_step
          waitForRunCompletion: false
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing first_step $pipeline_name"
  - name: pipeline2
    steps:
      - name: first_step
        type: TriggerPipeline  
        configuration:
          pipelineName:   pipeline3
          stepName:       first_step
          waitForRunCompletion: false
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing first_step $pipeline_name"
      - name: second_step
        type: TriggerPipeline  
        configuration:
          inputSteps:
            - name: first_step
          pipelineName:   pipeline4
          stepName:       first_step
          waitForRunCompletion: false
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing second_step $pipeline_name"
  - name: pipeline3
    steps:
      - name: first_step
        type: TriggerPipeline  
        configuration:
          pipelineName:   pipeline4
          stepName:       first_step
          waitForRunCompletion: false
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing first_step $pipeline_name"
  - name: pipeline4
    steps:
      - name: first_step
        type: TriggerPipeline  
        configuration:
          pipelineName:   pipeline5
          stepName:       first_step
          waitForRunCompletion: false
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing first_step $pipeline_name"
  - name: pipeline5
    steps:
      - name: first_step
        type: TriggerPipeline  
        configuration:
          pipelineName:   pipeline6
          stepName:       first_step
          waitForRunCompletion: true
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing first_step $pipeline_name"
      - name: second_step
        type: TriggerPipeline  
        configuration:
          inputSteps:
            - name: first_step
          pipelineName:   pipeline7
          stepName:       first_step
          waitForRunCompletion: true
          integrations:
            - name: myPlatformToken
        execution:
          onStart:
            - echo "executing second_step $pipeline_name"
  - name: pipeline6
    steps:
      - name: first_step
        type: Bash  
        configuration:
          inputResources:
            - name: propertyBag3
        execution:
          onExecute:
            - echo "executing pipeline6"
  - name: pipeline7
    steps:
      - name: first_step
        type: Bash  
        configuration:
          inputResources:
            - name: propertyBag3
        execution:
          onExecute:
            - echo "executing pipeline7"