Custom Pipelines

Custom Pipelines can be used to modify the regular pipelines to deploy projects. They can have additional steps along with the existing deployment steps. Custom pipelines do not have any UI but it is possible to enable/disable custom pipelines.

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

Enable Custom Pipelines

  1. Login to the OpenShift Admin Console

  2. Navigate to AdministrationCustom Resource Definitions

  3. Search for the name k5-project and select the k5-project

  4. Navigate to Instances

  5. Search for the k5-project for which custom pipelines needs to be enabled

  6. Select the k5-project and navigate to YAML

  7. Change the property value of spec.configuration.pipelineManager.useDefaultPipelineTemplates to false

  8. Click on Save

After saving the Custom Resource Definition custom pipelines are enabled successfully. Proceed with Edit Pipeline Templates to configure custom pipelines

Edit Pipeline Templates

There are different pipeline templates/task available for deploying low-code or pro-code projects. Based on the project type choose a pipeline template/task and do required changes:

Pipeline Templates

  • k5-template-build-managed-custom-java → for pro-code projects in Java

  • k5-template-build-managed-custom-node → for pro-code projects in Node

  • k5-template-build-managed-ddd-java → for low-code projects in Java

  • k5-template-build-managed-ddd-node → for low-code projects in Node

Task Templates

  • k5-build-managed-java → for pro-code projects in Java

  • k5-build-managed-custom-node → for pro-code projects in Node

  • k5-build-managed-ddd-java → for low-code projects in Java

  • k5-build-managed-node → for low-code projects in Node

Update and save the pipeline templates/task as per requirements. Once after saving the changes, the new pipelines created for this k5-project will use the new Custom Pipelines.

Note: FSW will not validate Custom Pipelines/Tasks, it's the user's responsibility to take care of it. In case of task templates, FSW maintains the same edited steps order. While creating new tasks, do not use additional parameters or resources apart from the default parameters/resources. Currently those are not being supported. Also declare only those params/resources which are being used in the new task otherwise the pipeline may not work properly.

Migrating existing Pipelines to new Custom Pipelines

Once after Custom Pipelines are enabled use this step to migrate all existing pipelines in a k5-project to use the new Custom Pipelines.

  1. Login to the OpenShift Admin Console

  2. Navigate to AdministrationCustom Resource Definitions

  3. Search for the name k5-project and select the k5-project

  4. Navigate to Instances

  5. Search for the k5-project for which Custom Pipelines needs to be enabled

  6. Select k5-project and navigate to YAML

  7. Change the property value of spec.configuration.pipelineManager.migrateExistingPipelines to true

  8. Click on Save

After saving the Custom Resource Definition all existing pipelines will use the new custom templates to migrate.

Warning: After migration of existing pipelines all the pipeline runs will be deleted.

Disable Custom Pipelines

Once after Custom Pipelines are enabled use this step to disable them.

  1. Login to the OpenShift Admin Console

  2. Navigate to AdministrationCustom Resource Definitions

  3. Search for the name k5-project and select the k5-project

  4. Navigate to Instances

  5. Search for the k5-project for which Custom Pipelines needs to be disabled

  6. Select k5-project and navigate to YAML

  7. Change the property value of spec.configuration.pipelineManager.useDefaultPipelineTemplates to true

  8. Click on Save

After saving the Custom Resource Definition a all newly created pipelines will use default pipelines templates. Use the above steps to migrate all existing pipelines to default pipelines.

Note: After disabling Custom Pipelines, please migrate all existing pipelines to use the default pipeline templates as described in Migrating existing Pipelines to new Custom Pipelines