このページは、お客様の言語ではご利用いただけません。Huawei Cloudは、より多くの言語バージョンを追加するために懸命に取り組んでいます。ご協力ありがとうございました。

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
On this page

Configuring the Build Environment

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

Configure a global runtime environment for a build task.

CodeArts Build also allows you to use custom executors, such as LINUX, LINUX_DOCKER, WINDOWS, and MAC (Linux, Linux Docker, Windows, and macOS executors). For build scenarios supported by these executors, see Table 1.

Table 1 Executor types and their description

Executor Type

Description

LINUX

LINUX_DOCKER

  • When you run the build task, CodeArts Build starts a Linux Docker container in which the task is run.
  • The entire build process runs in the container. Once the task is finished, the container automatically removes the build image, which includes the code pulled during the build, the process data, and the build products.
  • You can configure the mapping between the host directory and container directory to share the host directory in the image.
  • All build actions are supported except for Build with MSBuild, and you do not need to install the build environment.

WINDOWS

  • You will run build tasks on the Windows executor. This allows you to execute Windows-related build tasks.
  • You can use Git Bash to run the shell script for your build.
  • Only the following build actions are available: Running Shell Commands, Uploading a Software Package to Release Repos, and Downloading a Package from Release Repos.
  • You can use Windows 7, Windows 10, Windows Server 2012, or Windows Server 2016.
  • Before customizing a Windows executor, ensure that you have installed the JDK and Git.
  • Install the compilation tool. For example, install Maven if you will use it for your build.

MAC

Build on GUI

CodeArts Build presets the Configure Build Environment action. Set the parameters according to Table 2.

Table 2 Build environment parameters

Parameter

Description

Environment

x86/Kunpeng (Arm) server

NOTE:

Select the appropriate type of host you intend to use for software running on different chipset architecture. For example, if your software is designed for Arm (Kunpeng) servers, select Arm (Kunpeng).

Execution Host

Select the compute resource used to run your build task. In CodeArts Build, virtual machines (VMs) are used. Executors can be built-in or custom executors.

  • Built-in executor: Provided by CodeArts Build with out-of-the-box availability. The default executor specifications are 2 vCPUs and 8 GB memory.
  • Custom executor: Compute resources provided by users. They can be hosted in CodeArts Build after registration. CodeArts Build schedules these executors to run build tasks. For details, see Table 1.

You can select a built-in or custom executor. A custom executor is the agent executor added to the agent pool. For details about how to customize an executor, see Agent Pools.

Mapping Between Host and Container Directories

Set up the directory mapping between the custom executor and the container, and then you can mount files like dependencies from the custom executor to the container for your builds. (This mapping needs to be set when Execution Host is set to Custom executor.)

If the Host Directory is set to /home and the Container Directory is set to /opt, then the content in the executor's local /home directory will be mounted to the /opt directory in the container.

Build with Code

Modify env settings in the YAML file by referring to the following sample code of build environment configurations.

1
2
3
4
5
6
7
version: 2.0 # The version number is a mandatory and unique parameter that must be set to 2.0.
env: # Optional. It defines the build environment. x86 is used by default if neither env or envs is set.
  resource:
    type:docker # Agent pool type. The value can be docker or custom. docker indicates that the default executor is used, and custom indicates that a custom executor is used.
    arch:X86 # The host type of the build environment can be x86 or Arm.
    class:8 vCPUs | 16 GB # The specification can be: 2 vCPUs | 8 GB, 4 vCPUs | 8 GB, 8 vCPUs | 16 GB, 16 vCPUs | 32 GB, or 16 vCPUs | 64 GB. This parameter is not required when the agent pool type is set to a custom one.
    pool:Mydocker #Agent pool name. This parameter is required when the agent pool type is set to a custom one.

Add the following code information to the YAML file for your code-based build by referring to the following sample code of BuildSpace.

NOTE:

You have an available environment with custom executors.

version: 2.0
buildspace: # BuildSpace is used.
  fixed: true
  path: kk  
  clean: true
  clean_exclude:
    - cache # Excluded path
    - aa # Excluded path
    - bb # Excluded path
Table 3 Parameters in the sample code of BuildSpace

Parameter

Type

Description

fixed

String

Optional.

In CodeArts Build, an empty path (for example, /devcloud/ws/sMMM/workspace/j_X/) is randomly assigned to a build task as the root directory by default. This directory is called a "BuildSpace". Even for build tasks in the same project, BuildSpaces are randomly assigned to them.

However, a fixed BuildSpace path is necessary in some scenarios. CodeArts Build allows users to configure BuildSpace to specify a fixed directory for a build.

  • true: A fixed path is used.
  • false: A random path is used.

The default value is false.

path

String

Optional.

The fixed path is in the following format: /opt/cloud/slavespace/usr1/+"${domainId}"+/. You can set the path parameter to add a path after the fixed path.

For example, if the path is set to kk, the fixed path is /opt/cloud/slavespace/usr1/+"${domainId}"+/kk.

clean

String

Optional.

  • true: The fixed path will be cleared. Files in the fixed path will be deleted each time the build task is complete.
  • false: The fixed path will not be cleared. When the total size of files reaches the maximum capacity of the workspace, you need to manually free up space by setting clean to true.
    NOTE:
    • If there is no clearance setting for the fixed path, all files within the current tenant's fixed path will be automatically deleted once the total file size reaches the upper limit of the workspace.
    • The workspace refers to the custom executor specification.

The default value is true.

clean_exclude

String

Optional. Specify paths to exclude from the cleanup. Only level-1 folders in a fixed path can be specified.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback