第 5 章 Working with Red Hat OpenShift Pipelines using the Developer perspective


You can use the Developer perspective of the OpenShift Container Platform web console to create CI/CD Pipelines for your software delivery process.

In the Developer perspective:

  • Use the Add Pipeline Pipeline Builder option to create customized Pipelines for your application.
  • Use the Add From Git option to create Pipelines using operator-installed Pipeline templates and resources while creating an application on OpenShift Container Platform.

After you create the Pipelines for your application, you can view and visually interact with the deployed Pipelines in the Pipelines view. You can also use the Topology view to interact with the Pipelines created using the From Git option. You need to apply custom labels to a Pipeline created using the Pipeline Builder to see it in the Topology view.

Prerequisites

  • You have access to an OpenShift Container Platform cluster and have switched to the Developer perspective in the web console.
  • You have the OpenShift Pipelines Operator installed in your cluster.
  • You are a cluster administrator or a user with create and edit permissions.
  • You have created a project.

5.1. Constructing Pipelines using the Pipeline Builder

In the Developer perspective of the console, you can use the Add Pipeline Pipeline Builder option to:

  • Construct a Pipeline flow using existing Tasks and ClusterTasks. When you install the OpenShift Pipelines Operator, it adds reusable Pipeline ClusterTasks to your cluster.
  • Specify the type of resources required for the Pipeline Run, and if required, add additional parameters to the Pipeline.
  • Reference these Pipeline resources in each of the Tasks in the Pipeline as input and output resources.
  • The parameters for a Task are prepopulated based on the specifications of the Task. If required, reference any additional parameters added to the Pipeline in the Task.

Procedure

  1. In the Add view of the Developer perspective, click the Pipeline tile to see the Pipeline Builder page.
  2. Enter a unique name for the Pipeline.
  3. Select a Task from the Select task list to add a Task to the Pipeline. This example uses the s2i-nodejs Task.

    1. To add sequential Tasks to the Pipeline, click the plus icon to the right or left of the Task, and from the Select task list, select the Task you want to add to the Pipeline. For this example, use the plus icon to the right of the s2i-nodejs Task to add an openshift-client Task.
    2. To add a parallel Task to the existing Task, click the plus icon displayed below the Task, and from the Select Task list, select the parallel Task you want to add to the Pipeline.

      图 5.1. Pipeline Builder

      op pipeline builder
  4. Click Add Resources to specify the name and type of resources that the Pipeline Run will use. These resources are then used by the Tasks in the Pipeline as inputs and outputs. For this example:

    1. Add an input resource. In the Name field, enter Source, and from the Resource Type drop-down list, select Git.
    2. Add an output resource. In the Name field, enter Img, and from the Resource Type drop-down list, select Image.
  5. The Parameters for a Task are prepopulated based on the specifications of the Task. If required, use the Add Parameters link to add additional parameters.
  6. A Missing Resources warning is displayed on a Task if the resources for the Task are not specified. Click the s2i-nodejs Task to see the side panel with details for the Task.

    图 5.2. Tasks details in Pipelines Builder

    op pipeline builder task details
  7. In the Task side panel, specify the resources and parameters for it:

    1. In the Input Resources Source section, the Select Resources drop-down list displays the resources that you added to the Pipeline. For this example, select Source.
    2. In the Output Resources Image section, click the Select Resources list, and select Img.
    3. If required, in the Parameters section, add more parameters to the default ones, by using the $(params.<param-name>) syntax.
  8. Similarly, add an input resource for the openshift-client Task.
  9. Click Create to create the Pipeline. You are redirected to the Pipeline Details page that displays the details of the created Pipeline. You can now use the Action button to start the Pipeline.

Optionally, you can also use the Edit YAML link, on the upper right of the Pipeline Builder page, to directly modify a Pipeline YAML file in the console. You can also use the operator-installed, reusable snippets and samples to create detailed Pipelines.

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.