apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: name: git-pipeline spec: description: A test pipeline. params: - name: clone_url type: string description: The git repository URL to clone from. - name: commit type: string description: The git hash to checkout. - name: feedback_url type: string description: The url to ssh into to post feedback using gerrit. - name: feedback_port type: string description: The port on the feedback url to use to post feedback. - name: use-gerrit type: string description: Should we report back to gerrit? default: "false" workspaces: - name: shared-data description: Shared data. - name: git-credentials description: My ssh credentials tasks: - name: fetch-repo workspaces: - name: output workspace: shared-data - name: ssh-directory workspace: git-credentials params: - name: url value: $(params.clone_url) - name: commit value: $(params.commit) taskRef: name: j7s-git-clone - name: cat-readme runAfter: ["fetch-repo"] workspaces: - name: source workspace: shared-data taskSpec: workspaces: - name: source steps: - image: docker.io/debian:latest script: | set -x cat $(workspaces.source.path)/README finally: - name: notify-gerrit-success when: - input: $(tasks.status) operator: notin values: ["Failed"] - input: $(params.use-gerrit) operator: in values: ["true"] params: - name: commit value: $(params.commit) - name: build-id value: $(context.pipelineRun.name) workspaces: - name: ssh-directory workspace: git-credentials taskRef: name: j7s-gerrit-success - name: notify-gerrit-failed when: - input: $(tasks.status) operator: in values: ["Failed"] - input: $(params.use-gerrit) operator: in values: ["true"] params: - name: commit value: $(params.commit) - name: build-id value: $(context.pipelineRun.name) workspaces: - name: ssh-directory workspace: git-credentials taskRef: name: j7s-gerrit-fail