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
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
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
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 (CCI)
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
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
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
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Step 5: Set Up a Function Update Pipeline

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

The pipeline allows you to release and update the helloworld function code in the functions repository to FunctionGraph.

Creating a Build Task

  1. Choose Build & CloudArtifact > CloudBuild, and click Create Task.
  2. Select functions for Source Code Repository and Blank Template for the template.
  3. Add these three actions: Run Shell Commands, Upload Files to OBS, and Upload Deployment Package to CloudRelease.
    1. Configure the Run Shell Commands action.
      # Build a function deployment package.
      cd helloworld
      zip helloworld_deploy.zip cam.yaml
      # Build a function code package.
      cd code
      zip -rp helloworld.zip *
      Figure 1 Run Shell Commands
    1. Configure the Upload Files to OBS action.
      Figure 2 Upload Files to OBS
      • Action Name: Enter Upload Function Package to OBS.
      • Build Directory: Enter helloworld/code/helloworld.zip.
      • Bucket Name: Specify a private bucket to store the function code ZIP package.
      • OBS Directory: Enter function.
    2. Configure the Upload Deployment Package to CloudRelease action.
      Figure 3 Upload Deployment Package to CloudRelease
      • Action Name: Enter Upload Deployment Package to CloudRelease.
      • Package Location: Enter helloworld/helloworld_deploy.zip.
      • Version: Enter ${releaseVersion}.
  4. On the Parameters tab page, add releaseVersion and enable Runtime Settings.
    Figure 4 Setting parameters
  5. On the Basic Information tab page, change the task name to pipeline-update-function-deploy and click Save.

Creating a Deployment Task

  1. Choose Build & CloudArtifact > CloudDeploy, and click Create Task.
  2. Select Blank Template and click Next.
  3. Add the actions Select Deployment Source and Run Shell Commands.
    Figure 5 Adding deployment actions
    1. Configure the Select Deployment Source action.
      Figure 6 Setting action name to "Download Function Deployment Package to Deployment Host"
      • Action Name: Enter Download Function Deployment Package to Deployment Host.
      • Host Group: Select deploy-function.
      • Software package: Select /functions-helloworld-build/${releaseVersion}/helloworld_deploy.zip.
      • Download Path: Enter /home/function/deploy.
    2. Configure the Run Shell Commands action.
      Figure 7 Setting action name to "Deploy Function"
      • Action Name: Enter Deploy Function.
      • Host Group: Select deploy-function.
      • Shell Commands:
        cd /home/function/deploy
        unzip -o helloworld_deploy.zip -d helloworld_deploy
        python3 deploy.py helloworld_deploy "${key}"
  4. Add two parameters.
    • releaseVersion: Use the default value 1.0.0 and enable Runtime Settings.
    • key: Enter a key and enable Private Parameter.
      Figure 8 Setting parameters
  5. On the Basic Information tab page, change the task name to update-function-deploy and click Save.

Configuring a Pipeline

  1. Choose Build & CloudArtifact > CloudPipeline, and click Create Pipeline.
  2. Select functions for Source Code Repository and Blank Template for the template.
  3. Configure Build and Check.
    1. Add a build task, and select the functions-helloworld-build task.
      Figure 9 Adding a task
    2. Set releaseVersion as a pipeline parameter.
      Figure 10 Setting releaseVersion
    3. Click Save.
  4. Configure a deployment task.
    1. Add a stage named Deploy after Build_and_Check, set Task Execution to Serial, and click Save.
      Figure 11 Configuring the stage
    2. Click Add Task to add a deployment task named DeployhelloworldScript, and select the update-function-deploy task.
      Figure 12 Clicking Add Task
      Figure 13 Adding a task
    3. Set releaseVersion as a pipeline parameter.
      Figure 14 Setting releaseVersion
    4. Click Save.
  5. On the Basic Information tab page, change the pipeline task name to pipeline-update-function-helloworld and click Save.
  6. Execute the pipeline.

    Set the runtime parameter releaseVersion to 1.0.0 and click Execute.

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