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.
Customize an existing task
Navigate to tasks in the installation namespace
Login to the OpenShift Admin Console
Choose the namespace where the Solution Hub is installed
Navigate to Pipelines → Pipelines/Tasks
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.
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.