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 AddPipelinePipeline Builder option to create customized Pipelines for your application.

  • Use the AddFrom 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.

Constructing Pipelines using the Pipeline Builder

In the Developer perspective of the console, you can use the AddPipelinePipeline 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.

      op pipeline builder
      Figure 1. 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.

    op pipeline builder task details
    Figure 2. Tasks details in Pipelines Builder
  7. In the Task side panel, specify the resources and parameters for it:

    1. In the Input ResourcesSource 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 ResourcesImage 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.

Creating applications with OpenShift Pipelines

To create Pipelines along with applications, use the From Git option in the Add view of the Developer perspective. For more information, see Creating applications using the Developer perspective.

Interacting with Pipelines using the Developer perspective

The Pipelines view in the Developer perspective lists all the Pipelines in a project along with details, such as the namespace in which the Pipeline was created, the last PipelineRun, the status of the Tasks in the PipelineRun, the status of the PipelineRun, and the time taken for the run.

Procedure
  1. In the Pipelines view of the Developer perspective, select a project from the Project drop-down list to see the Pipelines in that project.

    op pipeline list
    Figure 3. Pipelines view in the Developer perspective
  2. Click the required Pipeline to see the Pipeline Details page. This page provides a visual representation of all the serial and parallel Tasks in the Pipeline. The Tasks are also listed at the lower right of the page. You can click the listed Tasks to view Task details.

  3. Optionally, in the Pipeline Details page:

    • Click the YAML tab to edit the YAML file for the Pipeline.

    • Click the Pipeline Runs tab to see the completed, running, or failed runs for the Pipeline. You can use the Options menu kebab to stop a running Pipeline, to rerun a Pipeline using the same parameters and resources as that of the previous Pipeline execution, or to delete a PipelineRun.

    • Click the Parameters tab to see the parameters defined in the Pipeline. You can also add or edit additional parameters as required.

    • Click the Resources tab to see the resources defined in the Pipeline. You can also add or edit additional resources as required.

Starting Pipelines

After you create a Pipeline, you need to start it to execute the included Tasks in the defined sequence. You can start a Pipeline Run from the Pipelines view, Pipeline Details page, or the Topology view.

Procedure

To start a Pipeline using the Pipelines view:

  1. In the Pipelines view of the Developer perspective, click the Options kebab menu adjoining a Pipeline, and select Start.

  2. The Start Pipeline dialog box displays the Git Resources and the Image Resources based on the Pipeline definition.

    For Pipelines created using the From Git option, the Start Pipeline dialog box also displays an APP_NAME field in the Parameters section, and all the fields in the dialog box are prepopulated by the Pipeline templates.

    1. If you have resources in your namespace, the Git Resources and the Image Resources fields are prepopulated with those resources. If required, use the drop-downs to select or create the required resources and customize the Pipeline Run instance.

  3. Optional: Modify the Advanced Options to add credentials to authenticate the specified private Git server or Docker registry.

    1. Under Advanced Options, click Show Credentials Options and select Add Secret.

    2. In the Create Source Secret section, specify the following:

      1. A unique Secret Name for the secret.

      2. In the Designated provider to be authenticated section, specify the provider to be authenticated in the Access to field, and the base Server URL.

      3. Select the Authentication Type and provide the credentials:

        • For the Authentication Type Image Registry Crendentials, specify the Registry Server Address that you want to authenticate, and provide your credentials in the Username, Password, and Email fields.

          Select Add Credentials if you want to specify an additional Registry Server Address.

        • For the Authentication Type Basic Authentication, specify the values for the UserName and Password or Token fields.

        • For the Authentication Type SSH Keys, specify the value for the SSH Private Key field.

      4. Select the check mark to add the secret.

    You can add multiple secrets based upon the number of resources in your Pipeline.

  4. Click Start to start the PipelineRun.

  5. The Pipeline Run Details page displays the Pipeline being executed. After the Pipeline starts, the Tasks and Steps within each Task are executed. You can:

    • Hover over the Tasks to see the time taken for the execution of each Step.

    • Click on a Task to see logs for each of the Steps in the Task.

    • Click the Logs tab to see the logs according to the execution sequence of the Tasks and use the Download button to download the logs to a text file.

      op pipeline run
      Figure 4. Pipeline run
  6. For Pipelines created using the From Git option, you can use the Topology view to interact with Pipelines after you start them:

    To see Pipelines created using the Pipeline Builder in the Topology view, customize the Pipeline labels to link the Pipeline with the application workload.

    1. On the left navigation panel, click Topology, and click on the application to see the Pipeline Runs listed in the side panel.

    2. In the Pipeline Runs section, click Start Last Run to start a new Pipeline Run with the same parameters and resources as the previous ones. This option is disabled if a Pipeline Run has not been initiated.