失败后继续 Tekton 管道(类似于 jenkins 管道 catchError 行为)

gsa*_*lis 3 jenkins-pipeline tekton tekton-pipelines openshift-pipelines

我有一个我想要的管道:

  1. 提供一些资源,
  2. 运行一些测试,
  3. 拆资源。

我希望在第 3 步中的拆卸任务在第 2 步中运行,不管测试是通过还是失败。据我所知,如果前一个任务成功,runAfter只会运行一个任务。

我尝试查看Condition,但似乎找不到示例...

我可以使用的其他任何东西或有人可以指出我的一些例子吗?

Dew*_*med 5

“最终”条款在 Tekton Pipelines 中实施(20 年 4 月)

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: pipeline-with-final-tasks
spec:
  tasks:
    - name: pre-work
      taskRef:
        Name: some-pre-work
    - name: unit-test
      taskRef:
        Name: run-unit-test
      runAfter:
        - pre-work
    - name: integration-test
      taskRef:
        Name: run-integration-test
      runAfter:
        - unit-test
  finally:
    - name: cleanup-test
      taskRef:
        Name: cleanup-cluster
    - name: report-results
      taskRef:
        Name: report-test-results
Run Code Online (Sandbox Code Playgroud)

设计文档:设计文档:https : //docs.google.com/document/d/1lxpYQHppiWOxsn4arqbwAFDo4T0-LCqpNa6p-TJdHrw/edit#

  • 它确实在“v0.15.0”版本中可用 (2认同)