Help Center/ CodeArts Pipeline/ Getting Started/ Generating a Software Package and Deploying It on a Host Through CodeArts Pipeline
Updated on 2025-07-28 GMT+08:00

Generating a Software Package and Deploying It on a Host Through CodeArts Pipeline

CodeArts Pipeline is a visualized and automated job scheduling platform. It needs to be used together with automated jobs of services such as CodeArts Build, CodeArts Check, CodeArts TestPlan, and CodeArts Deploy. You can orchestrate these automated jobs as needed. A single configuration triggers executions repeatedly to avoid inefficient manual operations.

In this section, we will create a pipeline to sequentially run code checks, build the software package, and deploy it on a host.

Figure 1 Basic operation process

Prerequisites

Preparations

  1. Create a project

    1. Log in to the Huawei Cloud console.
    2. Click in the upper left corner of the page and choose Developer Services > CodeArts Pipeline from the service list.
    3. Click Access Service to access the CodeArts Pipeline homepage.
    4. On the top navigation bar, click Homepage. On the displayed page, click Create Project, select Scrum, and enter a name Project01.
    5. Click OK.

    For details, see Creating a Scrum Project and a Work Item.

  2. Create a code repository and a code check task.

    1. Click the created project to access it, choose Code > Repo from the left navigation pane.
    2. Click Create Repository, select Template, and select the Java Maven Demo template.
    3. Click Next and enter the repository name Repo01.

      A code check task with the same name as the code repository is automatically created. Change the task name to CheckTask01 by referring to Creating a Task.

    4. Click OK.

    For details, see Creating a Repository Using a Template.

  3. Create a build task

    1. In the left navigation pane, choose CICD > Build.
    2. Click Create Task. On the displayed page, configure task information.
      1. Enter a name BuildTask01, select the code source Repo, select the created repository, select the default branch master, and click Next.
      2. Select the system template Maven, click OK. On the displayed Build Actions tab page, retain the default configurations.
    3. Click Save.

    For details, see Creating a Build Task.

  4. Create an application

    1. In the left navigation pane, choose Settings > General > Basic Resources, create a host cluster, and add the purchased host to the cluster.
    2. In the left navigation pane, choose CICD > Deploy.
    3. Click Create Application. On the displayed page, enter an application name DeployTask01, click Next, select Blank Template, and click OK.
    4. On the Deployment Actions tab page, add the Select Deployment Source action and configure the following information.
      • Source: Select Build task.
      • Environment: Click Create. On the displayed Environment Management page, click Create Environment, enter an environment name, and click Save. On the displayed Resources page, import the host to the environment.
      • Build Task: Select the created build task.
      • Download Path: Enter the deployment directory of the host. In this example, the directory is /usr/local/.
      • Retain default settings for other parameters.
    5. Click Save.

    For details, see Creating an Application with a Blank Template.

Create a pipeline

  1. Click the created project to access it, choose CICD > Pipeline from the left navigation pane.
  2. Click Create Pipeline and configure pipeline information.

    1. Configure the following basic information and click Next.
      Table 1 Pipeline information

      Parameter

      Configuration

      Name

      Pipeline name. Enter a maximum of 128 characters, including letters, digits, underscores (_), and hyphens (-). For example, Pipeline01.

      Pipeline Source

      Code source associated with the pipeline. Select Repo.

      Repository

      Code repository associated with the pipeline. Select the created code repository.

      Default Branch

      Branch used when a pipeline is executed manually or at a specified time. Select the master branch.

    2. Select Blank Template and click OK.

  3. Go to the Task Orchestration page. Two stages (Pipeline Source and Stage_1) are generated by default. Click Stage to add a new stage (Stage_2).

    Figure 2 Task orchestration
    1. Add a code check task
      1. Click New Job under Stage_1.
      2. Click the Check type and search for the Check extension.
      3. Move the cursor to the extension, click Add, select the created code check task, and set Check Mode to Full.
      Figure 3 Adding a code check task
    2. Add a build task
      1. Click Parallel Job under Stage_1, or click under the code check job. Select From empty.

        The code check job and build job can be in parallel or serial.

      2. In the displayed window, click the Build type and search for the Build extension.
      3. Move the cursor to the extension, click Add, select the created build task, and select the repository associated with the build task.
      Figure 4 Adding a build task
    3. Add an application
      1. Click Job under Stage_2 and select From empty.
      2. In the displayed window, click the Deploy type and search for the Deploy extension.
      3. Move the cursor to the extension, click Add, select the created application, and associate it with the added build task.
      Figure 5 Adding an application

  4. After the configuration, click Save.
  5. Execute the pipeline and check the pipeline execution result.

Executing a Pipeline

  1. Return to the pipeline list page, click in the Operation column, and select Manual Execution.
  2. In the displayed Execution Configuration window, retain the default settings, and click Execute.
  3. Click the pipeline name to go to the Execution History page.
  4. Click the execution number under Execution Message. On the Pipeline Details page, you can check the execution situation in real time.

    Click a job card to view its log.

  5. Rectify the fault based on the error message in case the pipeline fails to be executed. For details, see FAQs.

Checking the Pipeline Execution Result

  1. Click the avatar in the upper right corner.
  2. Click CodeArts Console.
  3. Click in the upper left corner, search for Elastic Cloud Server, and click it to access its console.
  4. Locate the ECS used for the deployment, click Remote Login in the Operation column.
  5. In the Other Login Modes area, select VNC Login, and click Log In.
  6. Enter the username and password for purchasing the ECS. Press Enter.
  7. Enter the following command and press Enter to go to the directory /usr/local configured during application creation.

    cd /usr/local

  8. Enter the following command and press Enter to check the deployed package.

    ls -al
    Figure 6 Checking the pipeline execution result

Related Information

CodeArts Pipeline provides built-in templates for you to quickly create pipelines. For more information, see Managing Pipeline Templates.