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.

Prerequisites
- You have enabled and authorized CodeArts Pipeline.
- You need to prepare a host with an EIP. You can use an existing host or purchase a Huawei Cloud ECS.
- You have the permission to create a project (either of the following conditions is met):
- Tenant Administrator. For details about how to grant the Tenant Administrator role to a user, see Creating a User Group and Assigning Permissions.
- CodeArts project creator. For details about how to grant the project creator role to a user, see Setting Project Creators.
Preparations
- Create a project
- Log in to the Huawei Cloud console.
- Click
in the upper left corner of the page and choose from the service list.
- Click Access Service to access the CodeArts Pipeline homepage.
- On the top navigation bar, click Homepage. On the displayed page, click Create Project, select Scrum, and enter a name Project01.
- Click OK.
For details, see Creating a Scrum Project and a Work Item.
- Create a code repository and a code check task.
- Click the created project to access it, choose Code > Repo from the left navigation pane.
- Click Create Repository, select Template, and select the Java Maven Demo template.
- 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.
- Click OK.
For details, see Creating a Repository Using a Template.
- Create a build task
- In the left navigation pane, choose CICD > Build.
- Click Create Task. On the displayed page, configure task information.
- Enter a name BuildTask01, select the code source Repo, select the created repository, select the default branch master, and click Next.
- Select the system template Maven, click OK. On the displayed Build Actions tab page, retain the default configurations.
- Click Save.
For details, see Creating a Build Task.
- Create an application
- In the left navigation pane, choose , create a host cluster, and add the purchased host to the cluster.
- In the left navigation pane, choose CICD > Deploy.
- Click Create Application. On the displayed page, enter an application name DeployTask01, click Next, select Blank Template, and click OK.
- 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.
- Click Save.
For details, see Creating an Application with a Blank Template.
Create a pipeline
- Click the created project to access it, choose CICD > Pipeline from the left navigation pane.
- Click Create Pipeline and configure pipeline information.
- 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.
- Select Blank Template and click OK.
- Configure the following basic information and click Next.
- 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
- Add a code check task
- Click New Job under Stage_1.
- Click the Check type and search for the Check extension.
- 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 - Add a build task
- 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.
- In the displayed window, click the Build type and search for the Build extension.
- 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 - Click Parallel Job under Stage_1, or click
- Add an application
- Click Job under Stage_2 and select From empty.
- In the displayed window, click the Deploy type and search for the Deploy extension.
- 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
- Add a code check task
- After the configuration, click Save.
- Execute the pipeline and check the pipeline execution result.
Executing a Pipeline
- Return to the pipeline list page, click
in the Operation column, and select Manual Execution.
- In the displayed Execution Configuration window, retain the default settings, and click Execute.
- Click the pipeline name to go to the Execution History page.
- 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.
- 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
- Click the avatar in the upper right corner.
- Click CodeArts Console.
- Click
in the upper left corner, search for Elastic Cloud Server, and click it to access its console.
- Locate the ECS used for the deployment, click Remote Login in the Operation column.
- In the Other Login Modes area, select VNC Login, and click Log In.
- Enter the username and password for purchasing the ECS. Press Enter.
- Enter the following command and press Enter to go to the directory /usr/local configured during application creation.
cd /usr/local
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot