Updated on 2025-07-30 GMT+08:00

Configuring Pipelines

CodeArts Pipeline provides a visualized and customizable software pipeline for automatic delivery. It supports multiple task types, such as code check, build, and deployment tasks.

As the project progresses, each stage (build, release, and deployment) becomes more and more standardized. However, each stage is relatively independent and incomplete and cannot deliver business value directly. Only by effectively connecting each stage to form a complete continuous delivery pipeline can we truly improve the efficiency and quality of software release and continuously create business value.

This section describes how developer Chris connects code check, build, and deployment tasks for continuous delivery.

Introduction to Preset Pipelines

There are five pipeline tasks preset in the sample project. You can view and use them as needed.

Table 1 Preset pipeline tasks

Preset Pipeline Task

Description

phoenix-workflow

Implements basic functions.

phoenix-workflow-test

Runs in the test environment.

phoenix-workflow-work

Implements the Worker function.

phoenix-workflow-result

Implements the Result function.

phoenix-workflow-vote

Implements the Vote function.

Configuring and Executing a Pipeline

Assume that you use the phoenix-cd-cce application for deployment. Clear the workloads in the cluster before executing a pipeline. For details, see Checking Your CCE Cluster.

  1. Go to the Phoenix Mall project, and choose CICD > Pipeline from the navigation pane.
  2. In the Operation column of the phoenix-workflow pipeline, click and choose Edit.
  3. Click the Parameters tab, and verify that the default values of dockerOrg and dockerServer are the same as those of the phoenix-sample-ci build task.
  4. Add a code check stage.

    1. Click the Task Orchestration tab and click between Pipeline Source and Build. A new stage Stage_1 is displayed.
    2. Click next to Stage_1. In the Edit Stage window, enter the stage name Check and click Confirm.
      Figure 1 Editing the stage name
    3. Click Job, and select From empty. The job creation window is displayed on the right.
    4. Find the Check job in the list, and click Add.
      Figure 2 Adding the Check job
    5. Select the phoenix-codecheck-worker task and click OK.

      The Check job is displayed.

  5. Configure a deployment task.

    Click the deployment task name, select the associated build task phoenix-sample-ci, and check the values of configuration items.

    • The configurations of task phoenix-sample-standalone must be the same as those on the Parameters page of the task with the same name in CodeArts Deploy.
    • The configurations of task phoenix-cd-cce must be the same as those on the Parameters page of the task with the same name in CodeArts Deploy.

    Two deployment tasks are added in this example. If you selected only one deployment mode in preceding steps, keep the corresponding task and delete the other one.

  6. Click Save and Execute. In the displayed dialog box, click Execute to start the pipeline.

    If is displayed, the pipeline is successfully executed.

    If the pipeline fails, click the cause to view logs. Then rectify the fault by referring to CodeArts Pipeline FAQs.

Configuring Pass Conditions

To control the code quality, the code must be scanned and the number of errors must be within a reasonable range before being released. By adding quality gates, you can effectively automate the control process.

  1. Go to the Phoenix Mall project, and choose CICD > Pipeline from the navigation pane.
  2. In the Operation column of the phoenix-workflow pipeline, click and choose Edit.
  3. Click the Task Orchestration tab. In the Check stage, click Pass Conditions. The Pass Conditions window is displayed on the right.
  4. Click Add next to Pass-Conditions-of-Standard-Policies.
  5. Select SystemPolicy and click OK.

    The new pass condition is displayed.

  6. Click Save and Execute.

    If the number of check issues does not meet the pass conditions, the pipeline will fail.

    Figure 3 Executing a pipeline

Configuring Code Changes to Automatically Trigger a Pipeline

Through the following configuration, code changes can automatically trigger pipeline execution, implementing continuous project delivery.

  1. Go to the Phoenix Mall project, and choose CICD > Pipeline from the navigation pane.
  2. In the Operation column of the phoenix-workflow pipeline, click and choose Edit.
  3. Click the Execution Plan tab, select Code commit under Trigger Events, select the master branch, and click Save.

    Figure 4 Configuring the execution plan

    The modified execution plan is displayed.

  4. Modify the code and push it to the master branch. Then check whether the pipeline is automatically executed.