Custom Pipelines

Custom Pipelines used to modify the pipelines used to deploy the built solutions to have additional steps along with the existing deployment steps. Custom pipelines does not have any UI. It is possible to enable/disable custom Pipelines.

Prerequisites:

Access to openshift admin console

Clear understanding in Tekton pipelines, pipelines runs, tasks, task runs, also Experience in writing pipelines/tasks using YAML

Enable Custom Pipelines for Solutions

  • Login to openshift admin console

  • Navigate to Administration → Custom Resource Definitions

  • Search for the name k5project and select the k5project

  • Navigate to instances

  • Search for the k5project for which custom pipelines needs to be enabled

  • Select k5project and navigate to YAML

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

  • Click on Save

After saving 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 custom java, ddd-node, ddd-java and custom-node solutions. Based on the solution type choose pipeline template/task and do required changes

Navigate to pipeline templates/tasks in k5Project

  • Login to openshift admin console

  • Choose K5Project

  • Navigate to Pipelines → pipelines / tasks

Pipeline Templates

  • k5-template-build-managed-custom-java → for custom java solutions

  • k5-template-build-managed-custom-node → for custom node solutions

  • k5-template-build-managed-ddd-java → for ddd java solutions

  • k5-template-build-managed-ddd-node → for ddd node solutions

Task Templates

  • k5-build-managed-java → for custom java solutions

  • k5-build-managed-custom-node → for custom node solutions

  • k5-build-managed-ddd-java → for ddd java solutions

  • k5-build-managed-node → for ddd node solutions

update and save pipeline templates/task as per the requirements. once after saving the new changes all the new pipelines created for k5Project will use new custom pipelines

Note:

1) FSW will not validates custom pipelines / tasks, its user responsibility to take care of it.

2) In case of Task's templates, FSW maintains same edited steps order

3) while creating new Task's, 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's else 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 k5project to use new custom pipelines.

  • Login to openshift admin console

  • Navigate to Administration → Custom Resource Definitions

  • Search for the name k5project and select the k5project

  • Navigate to instances

  • Search for the k5project for which custom pipelines needs to be enabled

  • Select k5project and navigate to YAML

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

  • Click on Save

After saving custom resource definition all existing pipelines will use new custom templates to migrate.

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

Disable Custom Pipelines for Solutions

Once after custom pipelines are enabled use this step to disable custom pipelines.

  • Login to openshift admin console

  • Navigate to Administration → Custom Resource Definitions

  • Search for k5project and select the k5project

  • Navigate to instances

  • Search for the k5project for which custom pipelines needs to be disabled

  • Select k5project and navigate to YAML

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

  • Click on Save

After saving custom resource definition all newly created pipelines will use default pipelines templates. Use above step to migrate all existing pipelines to default pipelines.

Note: After disabling custom pipelines please do migrate existing pipelines to use default pipeline templates using Migrating existing Pipelines to new Custom Pipelines step