El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

Uploading Files to OBS

Updated on 2025-01-03 GMT+08:00

CodeArts Build allows you to upload build products to OBS. You can use this build action as required.

For details about the restrictions on using OBS, see Restrictions and Limitations.

Preparations

To upload files to OBS of other users, perform the following operations.
  1. Access the CodeArts Build Homepage from the project list.
  2. In the navigation pane, choose Settings > General > Service Endpoints.
  3. Select IAM user from the Create Endpoint drop-down list box. In the displayed dialog box, enter the following information and click Confirm.
    • Service Endpoint Name: Assign a custom name to the endpoint. Enter a maximum of 256 characters, including letters, digits, hyphens (-), underscores (_), periods (.), and spaces.
    • Access key ID (AK) and secret access key (SK) are used like passwords to authenticate users who make API requests.

      On the CodeArts Build homepage, click Console, hover the cursor on the username in the upper right corner, and choose My Credentials from the drop-down list. In the navigation pane on the left, choose Access Keys to create a user key.

Build on GUI

Add Upload Files to OBS, when configuring build actions. Set the parameters according to Table 1.

Table 1 Parameters for uploading files to OBS

Parameter

Description

Action Name

Assign a custom name to the build action. The name can contain:

  • Letters, digits, hyphens (-), underscores (_), commas (,), semicolons (;), colons (:), periods (.), slashes (/), and parentheses.
  • 1 to 128 characters.

Authorized User

Select the user. Your files will be pushed to the user's OBS.

  • Current: Upload files to an OBS bucket of the current user.
  • Other: Upload files to OBS of a specific user by specifying an IAM account.

IAM Account

Expand the drop-down list and select the service endpoint created in Preparations for the specific IAM account. Then, use the service endpoint to push the files to the user's OBS.

This parameter is mandatory when Authorized User is set to Other.

Build Directory

Directory for storing build results. If no file name is specified for OBS storage, use wildcard characters to upload multiple files. Example: **/target/*.?ar uploads all JAR and WAR packages built with Maven.

Examples:
  • *.class: Matches files whose names end with .class in the current directory.
  • **/*.class: Recursively matches all files whose names end with .class in the current directory.
  • test/a??.java: Matches Java files whose names start with a followed by two characters in the test directory.
  • **/test/**/XYZ*: Recursively matches all files whose parent directory is test and whose names start with XYZ, for example, abc/test/def/ghi/XYZ123.

Bucket Name

Name of the target OBS bucket. (Cross-region upload is not supported.)

OBS Directory

Optional.

Directory for storing build results on OBS (for example, application/version/). You can leave this parameter blank or enter ./ to store build results to the OBS root directory.

File Name

Optional.

Enter the name (without the directory) that the resulting build file will be stored as in OBS.
  • If leave it as blank, you can upload multiple files and use the build product file name as the name it will be stored as in OBS.
  • If you do not leave it as blank, you can upload only one file, such as application.jar.

Upload Folder

You can choose whether to enable the function of uploading folders.

  • Yes: The folder is also uploaded.
  • No: The file is uploaded, but not the folder.

Headers

Optional.

Add one or more custom response headers during the file upload. The headers will be included in the response to download objects or query the object metadata.

For example, you can set the key to x-frame-options and value to false to prevent web pages stored in OBS from being embedded into by third-party web pages.

Continue After Failure

Specify whether to proceed after the current action fails by setting the parameter to either Yes or No.

Build with Code

Modify the code in the BUILD block in Creating a YAML File for Your Code-based Build by referring to the following sample code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
version: 2.0 # The value must be 2.0.
steps:
  BUILD:
    - upload_obs:
          inputs:
            artifact_path: "**/target/*.?ar"
            bucket_name: codecitest-obs
            obs_directory: "./"
          #   artifact_dest_name: ""
          #   upload_directory: true
          #   headers:
          #     x-frame-options: true
          #     test: test
          #     commit: ${commitId}
           ignore_fail: true
Table 2 Parameters in the sample code

Parameter

Type

Description

artifact_path

String

Optional.

Directory for storing build results. If no file name is specified for OBS storage, use wildcard characters to upload multiple files. Example: **/target/*.?ar uploads all JAR and WAR packages built with Maven.

Examples:
  • *.class: Matches files whose names end with .class in the current directory.
  • **/*.class: Recursively matches all files whose names end with .class in the current directory.
  • test/a??.java: Matches Java files whose names start with a followed by two characters in the test directory.
  • **/test/**/XYZ*: Recursively matches all files whose parent directory is test and whose names start with XYZ, for example, abc/test/def/ghi/XYZ123.

The default value is bin/*.

bucket_name

String

Name of the target OBS bucket. (Cross-region upload is not supported.)

obs_directory

String

Optional.

Directory for storing build results on OBS (for example, application/version/). You can leave this parameter blank or enter ./ to store build results to the OBS root directory.

The default value is ./.

artifact_dest_name

String

Optional.

Enter the name (without the directory) that the resulting build file will be stored as in OBS.
  • If leave it as blank, you can upload multiple files and use the build product file name as the name it will be stored as in OBS.
  • If you do not leave it as blank, you can upload only one file, such as application.jar.

upload_directory

Bool

Optional.

Specify whether to enable the function of uploading folders.

  • true: The folder of the build product is also uploaded.
  • false: All matched build products are uploaded to obs_directory in tile mode.

The default value is false.

headers

Map

Optional.

Add one or more custom response headers during the file upload. The headers will be included in the response to download objects or query the object metadata.

For example, you can set the value of x-frame-options to false to prevent web pages stored in OBS from being embedded into by third-party web pages.

ignore_fail

String

Whether to proceed after the current action fails.
  • true: Yes
  • Empty: No

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback