Updated on 2023-11-28 GMT+08:00

Changes and Pipelines

In microservices, you can create pipeline resources, set them to change pipelines, and associate them with microservice change resources. Compared with a common pipeline, a change pipeline has the following features:

  • A microservice can have only one change-triggered pipeline.
  • When the change pipeline is running, an integration branch is automatically created. After successful execution, the branch content is merged to the master branch.
  • After successful execution, the change status of the published pipeline is automatically updated.
  • Only one pipeline instance can run at one time.
  • The change pipeline cannot be triggered by an event or a schedule task.

Creating a Change Pipeline

  1. Access the microservice.
  2. In the microservice list, click a microservice. The Overview page is displayed.
  3. Switch to the Pipelines tab.
  4. Click Create Pipeline. On the page that is displayed, set basic information. For details, see Table 1.
    Table 1 Parameter description

    Parameter

    Description

    Project

    Project to which the microservice belongs, which cannot be changed.

    Name

    Pipeline name, which is generated based on the current time by default.

    Pipeline Source

    Only Repo is supported.

    Repository

    Name of the repository associated with the microservice, which cannot be changed.

    Default Branch

    Default branch associated with the microservice, which cannot be changed.

    CodeArts Repo HTTPS Authorization

    Configure authorization endpoints to elevate repository operation permissions. This function is used for microservice change pipelines and some repository operation extensions.

    Alias

    If an alias is specified, predefined parameters are generated for the repository and displayed on the Parameter Configuration tab page.

    Change-based Trigger

    A pipeline for which the Change-based Trigger option is enabled is a change pipeline. In the microservice pipeline list, the change pipeline is marked as .

    NOTE:

    A microservice can have only one change-triggered pipeline.

    Description

    Description of the pipeline.

  5. After setting all the parameters, click Next. On the page that is displayed, select a template as required to quickly create a task. You can also select Blank Template.
  6. After selecting a template, click OK, and then click Save.

Executing a Change Pipeline

  1. Access the microservice.
  2. In the microservice list, click a microservice. The Overview page is displayed.
  3. Switch to the Pipelines tab page.
  4. Locate the change pipeline and click the pipeline name. The pipeline details page is displayed.
  5. Click Run in the upper right corner. In the displayed Execution Configuration dialog box, perform the following operations:

    • Changes: The change list displays the changes in To be released or Releasing stage. Select one or more changes when running the change pipeline.
    • Runtime Parameters: If runtime parameters have been set for the pipeline, set the parameters as required and then save them. For details, see Using Parameters.
    • Execution Stages: Select one or more tasks to execute in the pipeline. By default, all tasks are executed.
    • Description: Enter the debugging information about the execution.
  6. After the configuration is complete, click Run. The change pipeline execution details page is displayed.

    When the change pipeline is running, the MergeReleaseBranch and MergeDefaultBranch stages will be added by default.

    • MergeReleaseBranch: The change pipeline automatically pulls a new branch from the default branch, integrates all feature branches of the current change into the new branch, and runs the pipeline based on the integration branch.
    • MergeDefaultBranch: The integration branch is merged back to the default branch.

Viewing the Result

After the execution is complete, you can view the execution result.

When the change pipeline is successfully executed, the status of all changes selected for pipeline running is changed to Released.

  • Click a pipeline name to go to its details page.
    • Click View More on the pipeline source card. In the dialog box that is displayed, view the changes selected for pipeline running.
    • Click a change name in the list to go to the change details page.
  • Click the Releases tab.
    • The release list page displays all changes in the To be released and Releasing stages.
    • You can enter a keyword in the search box to search for a change.
    • Click in the Operation column. In the dialog box that is displayed, click OK. The change is removed from the release list of the change pipeline, and the change status changes back to Developing.

    For a change in the Releasing stage, if the change pipeline is running, you can exit the release only after the change pipeline running is complete or stopped.