Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

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/ Best Practices/ Transferring CodeArts Pipeline Parameters to CodeArts Build and CodeArts Deploy

Transferring CodeArts Pipeline Parameters to CodeArts Build and CodeArts Deploy

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

Overview

Pipeline parameters can be transferred among different services (such as CodeArts Build and CodeArts Deploy). By creating a CI/CD pipeline, you can streamline data of build and deployment.

Procedure

The following describes how to transfer a pipeline version number parameter to a build and a deployment job.

Step 1: Create a Build Task

Step 2: Create an application

Step 3: Create and Execute a Pipeline

Step 4: Check Build and Deployment Results

Table 1 Procedure

Step

Description

Create a build task

Create a build task, add the version number parameter, and reference it in the build step.

Create an application

Create an application, add a software package parameter, and reference it in the deployment step.

Create and execute a pipeline

Create a pipeline, add the version number parameter, and add the created build task and application to the pipeline.

  • In the build task, reference the pipeline version number parameter.
  • In the application, reference the pipeline version number parameter.

Check the build and deployment results

Check whether:

  • The build package version number is a dynamic parameter transferred by the pipeline.
  • The software package has been obtained by the deployment job.

Preparations

Step 1: Create a Build Task

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner of the page and choose Developer Services > CodeArts Pipeline from the service list.
  3. Click Access Service.
  4. Click Homepage from the top navigation pane.Search for the project created in Preparations and access the project.
  5. In the left navigation pane, choose CICD > Build.
  6. Click Create Task and enter basic information.

    Table 2 Basic information

    Parameter

    Description

    Name

    Build task name. Enter BuildTask01.

    Project

    Keep the default value, which is the project of the build task.

    Code Source

    Code source associated with the build task. Select Repo.

    Repository

    Select the repository Repo01 created in Preparations.

    Default Branch

    Select master.

  7. Click Next, select the Maven template, and then click OK.
  8. On the Parameters tab page, add the releaseversion parameter, set the default value, and enable Runtime Settings.

    Figure 1 Creating a build parameter

  9. On the Build Actions page, click Upload Software Package to Release Repository. For the Version field, enter ${releaseversion}, and retain the default values for other fields.

    Figure 2 Configuring build actions

  10. Click Save.

Step 2: Create an application

  1. In the left navigation pane, choose Settings > General > Basic Resources, create a host cluster, and add the purchased host to the cluster.
  2. In the left navigation pane, choose CICD > Deploy.
  3. Click Create Application. On the displayed page, enter an application name DeployTask01, click Next, select Blank Template, and click OK.
  4. On the Parameters tab page, add the package_url parameter, set the default value, and enable Runtime Settings.

    Figure 3 Creating a deployment parameter

  5. On the Environment Management page, click Create Environment, enter the name Environment01, and import the host in the cluster to the environment.
  6. On the Deployment Actions tab page, add the Select Deployment Source action and configure the information as shown in the following table.

    Figure 4 Configuring deployment actions
    Table 3 Configuring deployment actions

    Parameter

    Description

    Action Name

    Retain the default value.

    Source

    Software package source. Select Artifact.

    Environment

    Environment for deployment. Select Environment01.

    Software Package

    Software package to be deployed. Obtain the build package uploaded by the build task to Release Repos. Set this parameter to ${package_url} to reference the package_url parameter.

    Download Path

    Path for downloading the software package to the target host. Enter /usr/local.

    Action Control

    Retain the default setting.

  7. Click Save.

Step 3: Create and Execute a Pipeline

  1. In the navigation pane on the left, choose CICD > Pipeline.
  2. Click Create Pipeline and configure pipeline information.

    1. Configure the following basic information and click Next.
      Table 4 Pipeline basic information

      Parameter

      Description

      Name

      Enter Pipeline01.

      Code Source

      Code source associated with the pipeline. Select Repo.

      Repository

      Select the repository Repo01 created in Preparations.

      Default Branch

      Select master.

    2. Select Blank Template and click OK.

  3. On the Parameter Configuration tab page, create the releaseversion parameter, set its default value to ${TIMESTAMP}, and enable Runtime Setting.
  4. On the Task Orchestration page, two stages (Code Source and Stage_1) are generated by default. Click Stage to add a new stage (Stage_2).

    Figure 5 Task orchestration
    1. Add a build job
      1. Click New Job under the Stage_1.
      2. Click the Build type and search for the Build extension.
      3. Move the cursor to the Build extension, click Add, select the created build task, select the repository associated with build task, and set releaseversion to ${releaseversion} to reference the releaseversion parameter of the pipeline.
      Figure 6 Adding a build job
    2. Add an application
      1. Click Job under Stage_2.
      2. In the displayed dialog box, search for the Deploy extension.
      3. Move the cursor to the Deploy extension, click Add, select the created application, enter the package path for package_url, and associate with the added build task, as shown in the following figure.
      Figure 7 Adding an application
      NOTE:

      package_url is the relative path of the build package in Release Repos. The path includes the build task name, version number, and package name. In this section, the pipeline releaseversion parameter indicates the version number.

  5. Click Save and Execute.

Step 4: Check Build and Deployment Results

After the pipeline is successfully executed, check whether the pipeline parameter has been transferred to the build and deployment jobs.

  • Check the build result
    1. In the navigation pane on the left, choose Artifact > Release Repos.
    2. Expand the project navigation tree on the left to check the uploaded build package.
      As shown in the following figure, the version number in the relative path is the timestamp transferred by the pipeline releaseversion parameter.
      Figure 8 Checking the software package
  • Check the deployment result
    1. Click the user name in the upper right corner.
    2. Click CodeArts Console.
    3. Click in the upper left corner and search for Elastic Cloud Server. Then, access the Elastic Cloud Server console.
    4. Locate the ECS used for deployment, click Remote Login in the Operation column.
    5. In the Other Login Modes area, select Log in using Remote Login on the management console and click Log In.
    6. Enter the username and password for purchasing the ECS. Press Enter.
    7. Enter the following command and press Enter to go to the directory /usr/local configured during the Create an Application step.
      cd /usr/local
    8. Enter the following command and press Enter. The deployed build package is displayed as shown in the following figure, which indicates that the pipeline parameter has been successfully transferred.
      ls -al
      Figure 9 Checking the deployment result

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback