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
Situation Awareness
Managed Threat Detection
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/ ServiceStage/ User Guide/ Continuous Delivery/ Creating a Source Code Job

Creating a Source Code Job

Updated on 2024-12-16 GMT+08:00

The software package or image package can be generated with a few clicks in a build job. In this way, the entire process of source code pull, compilation, packaging, and archiving is automatically implemented.

  • Images built in the x86-system jobs are ones of the x86 system.
  • Images built in the Arm-system jobs are ones of the Arm system.

Prerequisites

  1. A cluster has been created. For details, see Buying a CCE Cluster. Create a CCE Turbo or CCE Standard cluster based on your service requirements.
    NOTICE:
    • The build job starts a build container on the cluster node to perform build-related operations. To ensure build security, you are advised to perform security hardening on CCE cluster nodes. For details, see Forbidding Containers to Obtain Host Machine Metadata.
    • If you create a CCE Turbo cluster, set SNAT rules for the cluster so that the cluster can access the public network through the NAT gateway to pull source code. Otherwise, when a source code-build task is executed, the source code fails to be obtained because the public network cannot be accessed. As a result, the component deployment or build fails. For details about how to set SNAT rules for the cluster, see Accessing the Internet from a Container.
    • The build job depends on the JDK, Golang, Maven, Gradle, Ant, or Node.js compilation tool preconfigured in the build container.
    • Different IAM users under the same account can perform operations on the same cluster. To cancel the build permission from a specific IAM user, set the servicestage:assembling:create, servicestage:assembling:modify, and servicestage:assembling:delete permissions to Deny by referring to Creating a Custom Policy.
  2. An EIP has been bound to the build node. For details, see Binding an EIP to an Instance.

Creating a Source Code Job

  1. Log in to ServiceStage.
  2. Choose Continuous Delivery > Build.
  3. Click Create Source Code Job and set basic information about the build job by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Name

    Unique build job name.

    Enter 1 to 64 characters. Start with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).

    *Enterprise Project

    Enterprise projects let you manage cloud resources and users by project.

    It is available after you enable the enterprise project function.

    Description

    Build job description. Enter up to 64 characters.

    *Code Source

    • If you select a source code repository, create authorization by referring to Creating Repository Authorization and set the code source.
    • If you select a sample library, select a required sample.
    NOTE:

    The technology stack used by the source code must be Java, Tomcat, Node.js, Python, or PHP.

    *Cluster

    Select a cluster for build. The cluster must belong to the configured enterprise project.

    Key

    Set Key and Value of the node label and deliver the build job to the fixed node bound with an EIP.

    For details about how to add a label, see Adding a Node Label.

    Value

  4. Click Next.
  5. Select a build template.

    • If you select Maven, Ant, Gradle, Go, or Docker, you can compile and archive binary packages or Docker images at the same time. Go to 6.
    • If you select Custom, you can customize the build mode. Go to 8.

  6. Select an archive mode.

    • Not archived: No Docker build job is added or archived.
    • Archive binary package: No Docker build job is added and binary packages are archived.
    • Archive image compilation: Docker build job is added and Docker images are archived.

  7. Set mandatory parameters based on the archive mode selected in 6.
  8. Click Advanced Settings to configure the build environment.

    1. Click Add Plug-in in the left pane. The Select Job Type page is displayed.
    2. Click Select next to the target job type, add a job type, and set job parameters based on the task type.
      NOTICE:

      When the Build Common Cmd plug-in is added to the compilation process, pay attention to the following:

      • Exercise caution when inputting sensitive information in the echo, cat, or debug command, or encrypt sensitive information to avoid information leakage.
      • Enter the compilation command. A maximum of 512 characters are allowed. Otherwise, an error message is displayed, indicating that the task input parameter is incorrect. In this case, you can add multiple Build Common Cmd plug-ins to split the command.
      • When Language is set to Python and Python Framework Type is set to a Python project that complies with the WSGI standard, you need to set Main Python Module and Function of the Main Python Module. The following is an example of the main Python module and main function:

        Main Python Module: If the entry point file of the Python project is server.py, the main module name is server.

        Function of the Main Python Module: If the application function name of the Python project entry point file server.py is app=get_wsgi_application(), the function name of the main module is app.

  9. Determine whether to execute the build:

    • If yes, click Build to save the settings and execute the build job.
    • If no, click Save to save the settings only.

Follow-Up Operations

After the build, you can manage the application component on ServiceStage. For details, see Creating and Deploying a Component Based on a Container Using UI Configurations or Creating and Deploying a Component Based on a Container Using YAML Configurations.

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