Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ CodeArts Build/ Best Practices/ Building with Maven (Custom Executors, GUI)

Building with Maven (Custom Executors, GUI)

Updated on 2024-11-21 GMT+08:00

Scenario

If the built-in executors provided by CodeArts Build fall short of your service needs, you can use your own computing resources. Once registered, these computing resources can be hosted in CodeArts Build. You can then configure CodeArts Build to schedule them for running build tasks. In this practice, you configure actions Build with Maven and Upload to Release Repo and run your build on custom executors.

These steps depend on the following services:

Requirements

  • You have permissions for CodeArts Artifact.
  • You have permissions for CodeArts Repo.

Prerequisites

You have purchased an Elastic Cloud Server (ECS) for your custom executors by referring to Purchasing an ECS.

Procedure

Table 1 Steps

Step

Description

Creating a Project

Create a project.

Creating an Agent Pool

Create a pool of custom executors (agent pool).

Creating a CodeArts Repo Repository

Create a repository to store code.

Creating and Running a Build Task

Create a build task that includes actions Build with Maven and Upload to Release Repo.

Viewing the Build Task and Its Result

Check the build logs to verify the executors used for the build task and view the uploaded software package in CodeArts Artifact.

Creating a Project

  1. Log in to the Huawei Cloud console with your Huawei Cloud account.
  2. Click in the upper left corner and choose Developer Services > CodeArts from the service list.
  3. Click Access Service. The homepage of CodeArts is displayed.
  4. Click Create Project, and select the Scrum template.
  5. Set the project name to build-bestpractice, and leave the other parameters as default.
  6. Click OK to access the project.

Creating an Agent Pool

  1. On the navigation bar, click the username and choose All Account Settings.
  2. Choose Agent Management > Agent Pool.
  3. Click Create Pool. In the displayed dialog box, set parameters according to Table 2 and click Save.

    Table 2 Agent pool configuration

    Parameter

    Description

    Pool Name

    Assign a custom name to the pool, for example, custom_pool.

    Pool Type

    Select LINUX_DOCKER. When a task is initiated, a Linux Docker container will be started to run the task.

    Description

    (Optional) Enter additional information to describe the pool.

    This pool can be used by all users of the current account.

    (Optional) Selecting this option allows all users within the current account to use the pool.

  4. Click the name of the new pool (custom_pool is used in this practice). The pool configuration page is displayed.
  5. Click Create Agent. In the displayed dialog box, configure the agent according to Table 3 and leave the other parameters as default.

    Table 3 Parameters for creating an agent

    Parameter

    Description

    Install Docker

    Selecting this option mandates Docker installation.

    Install Docker automatically

    Toggling on the switch will automatically install Docker.

    AK

    Obtain the AK by referring to Obtaining an AK/SK.

    SK

    Obtain the SK by referring to Obtaining an AK/SK.

    Agent Name

    Assign a custom name to the agent, for example, agent_test_custom.

    Agent Workspace

    Enter an agent workspace that follows the standard Linux directory structure. For example, /opt/agent_test_custom.

  6. Select the check box to confirm that you have read and accept the agreements. Then click Generate Command and Copy Command. Click Close.

    Figure 1 Creating an agent

  7. Go to the ECS list page, find the row of the ECS purchased to meet prerequisites, click Remote Login, and run the command copied in 6, as instructed by Step 3.
  8. On the agent list page, click Refresh List. After the information is automatically synchronized in the background, a new item will be added to the list. The agent alias is agent_test_custom-mwlye1NlLG.

Creating a CodeArts Repo Repository

  1. On the navigation bar, choose Services > Repo. The CodeArts Repo homepage is displayed.
  2. Click New Repository. On the displayed page, expand the Project drop-down list and select the project name you specify when creating a project. Then, select Template as the repository type. Click Next.
  3. On the template selection page, select the Java Maven Demo template and click Next.
  4. On the displayed page, set Repository Name to custom_repo, and leave the other parameters as default. Click OK.

    Figure 2 shows the directory that stores files of the code repository.

    Figure 2 Directory that stores files of the code repository

Creating and Running a Build Task

  1. In the navigation pane, choose CICD > Build.
  2. Click Create Task. On the displayed Basic Information page, set parameters according to Table 4. Then, click Next.

    Table 4 Basic information

    Parameter

    Description

    Name

    Assign a custom name to the build task, for example, custom_task.

    Code Source

    Select Repo to pull the code hosted in a CodeArts Repo repository for your build.

    Repository

    Select custom_repo, the code repository created in Creating a CodeArts Repo Repository.

    Default Branch

    Keep the default value master.

    Description

    Enter additional information to describe the build task.

  3. Select the Maven template and click OK. The Build Actions page is displayed.
  4. Configure the build environment according to the following table. Leave the other parameters as default, and click Save and Run.

    Table 5 Environment parameters

    Parameter

    Description

    Execution Host

    Select Custom executor.

    Agent Pool

    Expand the drop-down list and select custom_pool you created in section "Creating an Agent Pool".

    Figure 3 Configuring the build environment

  5. In the displayed dialog box, click Confirm. The build task run page is displayed.

Viewing the Build Task and Its Result

  1. The console displays the logs of the build task as it runs. The log window automatically scrolls down to show new entries. As shown in Figure 4, the log indicates that the current build task is running on executor agent_test_custom-mwlye1NlLG in pool custom_pool created in section Creating an Agent Pool.

    Figure 4 Build logs

  2. The build task is considered successful if each build action is marked with after running.

    Figure 5 Build success

  3. Click action Upload to Release Repo. In the logs, you can find the path that stores the software package uploaded to the release repo: /custom_task/20240620.19/.
  4. In the navigation pane, choose Artifact > Release Repos. You can find the software package at /custom_task/20240620.19/javaMavenDemo-1.0.jar.

    Figure 6 Software package information

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback