tektoncd/pipeline

Support using a PipelineTask in the Pipeline CRD to run other Pipelines the same way we run a Task (nest pipelines in pipelines)

Offen

#2.134 geöffnet am 02.03.2020

 (31 Kommentare) (17 Reaktionen) (0 zugewiesene Personen)Go (1.943 Forks)auto 404
area/roadmaphelp wantedkind/featurelifecycle/frozen

Repository-Metriken

Stars
 (9.013 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 9T 3h) (137 gemergte PRs in 30 T)

Beschreibung

Pipelines group tasks together in a workflow. It would be incredibly useful to be able to re-use that mechanism to create sub-workflows.

Pipelines and Tasks both take Params, Workspaces, and generate Results so with a little work it should be possible to use a PipelineRef in place of a TaskRef when defining a Pipeline Task. For the other aspects required to generate a "sub"-PipelineRun these could be inherited from the parent PipelineRun.

Here's a basic example to illustrate syntax...

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipeline-calling-pipeline
spec:
  params:
  - name: best-param-ever
  workspaces:
  - name: pipeline-ws1
  tasks:
  - name: pipeline-in-task-clothing
    pipelineRef:
      name: some-sub-pipeline
    workspaces:
    - name: sub-pipeline-ws0
      workspace: pipeline-ws1
  - name: regular-task
    taskRef:
      name: some-task
    params:
    - name: new-input
      value: $(tasks.pipeline-in-task-clothing.results.some-ouput)
    workspaces:
    - name: src
      workspace: pipeline-ws1
    runAfter:
    - pipeline-in-task-clothing

In a nutshell, other than using pipelineRef in-place of taskRef the definitions behave the same.

Contributor Guide