This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4.7. Adding Triggers to a Pipeline
Triggers enable Pipelines to respond to external GitHub events, such as push events and pull requests. After you have assembled and started the Pipeline for the application, add TriggerBindings, TriggerTemplates, and an EventListener to capture the GitHub events.
Procedure
Copy the content of the following sample
TriggerBinding
YAML file and save it:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
TriggerBinding
:oc create -f <triggerbinding-yaml-file-name.yaml>
$ oc create -f <triggerbinding-yaml-file-name.yaml>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can create the
TriggerBinding
directly from thepipelines-tutorial
Git repository:oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/01_binding.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/01_binding.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the content of the following sample
TriggerTemplate
YAML file and save it:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
TriggerTemplate
:oc create -f <triggertemplate-yaml-file-name.yaml>
$ oc create -f <triggertemplate-yaml-file-name.yaml>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can create the
TriggerTemplate
directly from thepipelines-tutorial
Git repository:oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/02_template.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/02_template.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the contents of the following sample
EventListener
YAML file and save it:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
EventListener
:oc create -f <eventlistener-yaml-file-name.yaml>
$ oc create -f <eventlistener-yaml-file-name.yaml>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, you can create the
EvenListener
directly from thepipelines-tutorial
Git repository:oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/03_event_listener.yaml
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/release-tech-preview-2/03_triggers/03_event_listener.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expose the EventListener service as an OpenShift Container Platform route to make it publicly accessible:
oc expose svc el-vote-app
$ oc expose svc el-vote-app
Copy to Clipboard Copied! Toggle word wrap Toggle overflow