Pipeline Catalogs

Pipeline Catalogs for better integration with Tekton

As part of the Tekton Catalog enhancement proposal we’ve improved support for Tekton in Jenkins X so that you can

Source changes

If you upgrade your cluster to the latest version stream then you will find if you create a new quickstart that:

  • .lighthouse/jenkins-x directory contains the default CI/CD pipelines for Jenkins X with these files:

    • triggers.yaml to define the lighthouse presubmits and postsubmits (i.e. Pull Request pipelines and releases).
    • pullrequest.yaml defines the Pull Request pipeline using a Tekton PipelineRun
    • release.yaml defines the Release pipeline using a Tekton PipelineRun
  • jenkins-x.yml files are no longer used by default in new quickstarts instead we use the above. Note if you have projects using jenkins-x.yml files they are still supported if you import them into v3

Editing pipelines

You can now easily modify any of the PipelineRun resources in any git repository. Just look in the .lighthouse folder, for each sub folder edit the YAML files.

e.g. for the default Jenkins X CI/CD pipelines edit either:

  • .lighthouse/jenkins-x
    • pullrequest.yaml to edit the Pull Request pipeline
    • release.yaml to edit the Release pipeline

You can test out changes to the Pull Request pipeline by submitting changes in a Pull Request. Changes to a release only take place after merging the change to the main branch.

Add new pipelines

You can add new pipelines into a new folder inside .lighthouse at any time to reuse any tekton PipelineRun files you find from places like the tekton catalog or to add new PipelineRun resources you write by hand.

To setup a trigger so that lighthouse will start your pipeline on a presubmit (i.e. for Pull Requests) or for postsubmits (i.e. releases on main branches) you need to also add a triggers.yaml file which uses the lighthouse configuration file format.

You could look a the default .lighthouse/jenkins-x directory to see how all this works. The triggers.yaml file then refers to the tekton PipelineRun files via the source: attribute in a presubmits: or postsubmits: entry.

Changing the triggers

You can modify the .lighthouse/*/triggers.yaml file to modify the presubmits: and/or postsubmits: entries to do things like:

  • customise the rerun_command or trigger ChatOps comments for presubmits
  • configure the branches patterns for postsubmit triggers
  • add new entries for new pipelines; or pipelines with different pipeline_run_params entries to parameterise existing PipelineRun files differently

Upgrading pipelines and helm charts

You can upgrade any git repository in the same way you upgrade your clusters git repository by running the jx gitops upgrade command inside a git checkout of your repository:

cd my-quickstart-thingy
jx gitops upgrade

This will then upgrade any helm charts or pipeline catalogs you are using in your git repository with the latest versions.

After running this command you will usually have some changes in git you can review. If you are happy with the changes commit them and create a Pull Request so that they can get applied on your cluster.

git add *
git commit -a -m "fix: upgrade pipeline catalog"
git push

It is possible that you can have merge conflicts.

You can follow the inline git helper messages to resolve conflicts - or use your IDE to help figure out the merge issues more easily.


Last modified October 20, 2020: release 0.0.1921 (5342801)