How can I handle custom branches with Tekton?

We don’t use branch patterns with Tekton; they are a Jenkins specific configuration.

For Tekton we use the prow / lighthouse configuration to specify which branches trigger which pipeline contexts.

If you are using boot to install Jenkins X then you can create your own custom Scheduler custom resource in env/templates/myscheduler.yaml based on the default one that is included.

e.g. here is how we specify the branches used to create releases.

You can also create additional pipeline contexts; e.g. here’s how we add multiple parallel testing pipelines on the version stream via a custom Scheduler so that we can have many integration tests run in parallel on a single PR. Then each named context listed has an associated jenkins-x-$context.yml file in the source repository to define the pipeline to run like this example which defines the boot-lh context

You can then associate your SourceRepository resources with your custom scheduler by:

  • specifying the scheduler name on the property of your SourceRepository via kubectl edit sr my-repo-name )
  • specifying the scheduler name when you import a project via jx import --scheduler myname
  • specifying the default scheduler name in your dev Environment at before you import projects

If you are not using boot then you can use kubectl edit cm config and modify the prow configuration by hand - though we highly recommend using boot and GitOps instead; the prow configuration is easy to break if changing it by hand.