78 lines
1.9 KiB
YAML
78 lines
1.9 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Pipeline
|
|
metadata:
|
|
name: gerrit-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-gerrit-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
|
|
when:
|
|
- input: $(params.use-gerrit)
|
|
operator: in
|
|
values: ["true"]
|
|
params:
|
|
- name: commit
|
|
value: $(params.commit)
|
|
- name: build-id
|
|
value: $(context.pipelineRun.name)
|
|
- name: status
|
|
value: $(tasks.status)
|
|
- name: feedback_url
|
|
value: $(params.feedback_url)
|
|
- name: feedback_port
|
|
value: $(params.feedback_port)
|
|
workspaces:
|
|
- name: ssh-directory
|
|
workspace: git-credentials
|
|
taskRef:
|
|
name: j7s-gerrit-notify |