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
Help Center/ CodeArts Pipeline/ User Guide/ Creating a Pipeline/ Creating a Pipeline with YAML

Creating a Pipeline with YAML

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

Preparations

YAML File Example

The following YAML outlines a pipeline configuration. It consists of a build, a code check, and a deployment job in serial mode, and references pipeline parameters in the build job.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
env: # Define environment variables as key-value pairs. Environment variables can be referenced in any job within the pipeline.
  image_version: 1.0.0

jobs: # Define jobs included in the pipeline.
  build: # Job ID, which defines the unique identifier of the job.
    name: maven build # Job name, which is displayed on the GUI.
    steps: # Define the steps within the job.
      - name: My build step # Step name, which is displayed on the GUI.
        uses: CodeArtsBuild # Extension used for this step.
        with: # Define the extension's runtime parameters as key-value pairs. Variables defined in "env" can be referenced.
         jobId: 878b4d13cb284d9e8f33f988a902f57c # Job ID. On the job details page, copy the 32-bit string at the end of the browser URL to obtain the ID.
          artifactIdentifier: my_image
          version: ${{ env.image_version }}
  check:
    name: code check
    steps:
      - name: My check step
        uses: CodeArtsCheck
        with:
          jobId: 43885d46e13d4bf583d3a648e9b39d1e
          checkMode: full
  deploy:
    name: cce deploy
    needs: # Specify that this job should run only after the listed jobs have completed.
      - build
      - check
    if: ${{ completed() }} # Specify the condition under which this job should run.
    steps:
      - name: My deploy step
        uses: CodeArtsDeploy
        with:
          jobId: 9c5a5cda6ffa4ab583380f5a014b2b31
          version: ${{ env.image_version }}

Creating a Pipeline with YAML

  1. Access the CodeArts Pipeline homepage.
  2. Click Create Pipeline. Configure parameters by referring to Table 1.

    Table 1 Pipeline basic information

    Parameter

    Description

    Name

    Enter a pipeline name. Enter only letters, digits, underscores (_), and hyphens (-) with a maximum of 128 characters.

    Project

    Project that a pipeline belongs to.

    • If you access CodeArts Pipeline through the homepage, select a project as needed.
    • If you access CodeArts Pipeline through a project, the parameter cannot be changed.

    Code Source

    Select Repo (CodeArts Repo). It provides comprehensive code hosting services for enterprises and Git-based online code hosting services for software developers.

    NOTE:

    You can only select Repo to create a YAML-based pipeline.

    Orchestration Method

    Select YAML: Use YAML to orchestrate a pipeline (one YAML file can be used for multiple pipelines). Syntax auto-completion and validation are available.

    Repository

    Code repository associated with the pipeline.

    Default Branch

    Branch used when a pipeline is executed manually or at a specified time.

    Configuration File

    • New: Create a YAML file.
    • Existing: Orchestrate a pipeline based on the existing YAML file. The orchestrated content will overwrite the original YAML file. For details about how to write a YAML file, see YAML Syntax.

    YAML File

    This parameter is mandatory when Configuration File is set to Existing.

    Select a branch and enter the relative path of the YAML file.

    Repo Endpoint

    Configure an endpoint to enhance permissions for Repo. Endpoints are used for change-triggered pipelines and repository operation extensions. You can select an endpoint created in Preparations or click Create one to create an endpoint. For details, see Creating Service Endpoints.

    Alias

    After you set a repository alias, system parameters will be generated based on the alias. For example, Alias_REPOSITORY_NAME indicates the repository name. You can check the generated parameters on the Parameter Configuration page and reference them in a pipeline in the format of ${Parameter name}.

    Description

    Enter a maximum of 1,024 characters.

  3. After configuring the basic information, click OK. The Task Orchestration page is displayed.

    • You can edit the YAML file on the left. For details, see YAML Syntax.
    • You can add extensions to the YAML file from the extension list displayed on the right.

    You can verify YAML syntax during orchestration. Click Preview to switch to the graphical user interface.

  4. After orchestration, click Save, enter the commits message, and push commits in one of the following ways:

    • Push commits to the existing branch: If you created the pipeline with a new YAML file, commits will be pushed to the default branch. If you created a pipeline with an existing YAML file, commits will be pushed to the branch where the YAML file resides.
    • Push commits to a new branch: Commits will be pushed to a new branch. If you selected Create merge request, a merge request will be created for the new branch and the existing branch.

  5. Click Confirm.

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