Skip to content

Instantly share code, notes, and snippets.

@dlorenc
Last active April 23, 2019 20:39
Show Gist options
  • Save dlorenc/bdd3dc952cd9b9cb10b837224b031214 to your computer and use it in GitHub Desktop.
Save dlorenc/bdd3dc952cd9b9cb10b837224b031214 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1alpha1
kind: EventBinding
spec:
# Reference to the knative/eventing Source
sourceRef:
name: myGithubRepo
# PipelineResources to create/delete based on data in the event source
# This assumes the event data looks something like:
# {
# repo: {
# name: foo
# revision: abc232
# }
# }
#
# This data is made available via "valueFrom"
resourceTemplates:
- name: gitTemplate
template:
metadata:
spec:
type: git
params:
- name: revision
valueFrom:
fieldName: event.repo.revision
- name: url
valueFrom:
fieldName: event.repo.name
# This contains a mapping between these newly created PipelineResources and the Pipeline.
# Which resource goes where in the Pipeline inputs.
resources:
- templateRef:
name: gitTemplate
resourceName: git
# Reference to the pipeline to run
pipelineRef:
name: myPipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment