Pipeline Customization

Custom pipelines can be used to modify the regular pipelines to release or deploy projects. They can have additional steps along with the existing deployment steps. Custom pipelines do not have any UI but can be edited within the OpenShift Web Console.

Prerequisites

  • Access to the OpenShift Admin Console

  • Clear understanding of Tekton pipelines, pipeline runs, tasks, task runs, also experience in writing pipelines/tasks using YAML

  • A copy of the pipeline resources (yaml files) mentioned below.

Create a pipeline

In the CI/CD tab you can easily create a pipeline for your service (as usual).

Open the Pipeline-Definition

After creation, the pipeline is shown in the table. A click in the left column on the name of the pipeline will open it in the OpenShift Web Console, where we can apply our customizations.

Use a customized task

In the YAML tab, scroll down to the bottom. There you will see the task, that is used to realize the pipeline behavior. In the taskref, you can alter the name accordingly and save the changes afterwards.

Tip: You can see all available tasks by clicking PipelinesTasks in the left navigation area of the OpenShift Web Console

Customize an existing task

Task template

Copy the following task(s) to be able to adjust them:

  • k5-release-java → for projects in Java (release and deploy)

  • k5-release-node → for projects in Node (release and deploy)

Update and save the copy of the pipeline task as per requirements.

Note: Please be aware that changes to the default tasks will be overridden by the operator to their initial state.
Note: IBM Industry Solutions Workbench will not validate Custom Pipelines/Tasks, it's the user's responsibility to take care of it. While creating new tasks, do not use additional parameters or resources apart from the default parameters/resources. Also declare only those params/resources which are being used in the new task otherwise the pipeline may not work properly.

Customize Pipeline

The pipeline resource can also be altered directly to reflect the necessary changes. Triggering a custom pipeline from within the UI of IBM Industry Solutions Workbench, the function will always create a PipelineRun resource with the following spec:

spec:
  pipelineRef:
    name: <THE_NAME_OF_THE_PIPELINE>
  podTemplate:
    imagePullSecrets:
      - name: <THE_DEFAULT_PULL_SECRET>
  resources:
    - name: source
      resourceRef:
        name: <THE_NAME_OF_THE_GIT_RESOURCE>
    - name: cluster
      resourceRef:
        name: <THE_NAME_OF_THE_CLUSTER_RESOURCE>
  serviceAccountName: <THE_NAME_OF_THE_SERVICE_ACCOUNT>

This means, that currently the usage of PipelineResources is supported along with static parameters, that are given within the tasks. The concept of workspaces is not yet supported.