Help Center/
FunctionGraph/
Developer Guide/
Automated Deployment/
Hosting Function Code with DevCloud/
Step 4: Set Up a Pipeline for Updating the Function Deployment Script
Updated on 2025-03-13 GMT+08:00
Step 4: Set Up a Pipeline for Updating the Function Deployment Script
The pipeline allows you to release the function deployment script deploy.py to the deployment host for function updates.
Creating a Build Task
- Choose Build & CloudArtifact > CloudBuild, and click Create Task.
- Select functions for Source Code Repository and Blank Template for the template, and click OK.
- On the Build Actions tab page, add only Upload to CloudRelease. The action is displayed in the left pane.
- Click the Upload to CloudRelease action, and set parameters.
Figure 1 Setting parameters
- Action Name: Enter Upload deploy.py to CloudRelease.
- Package Location: Enter deploy/deploy.py.
- Version: Enter ${releaseVersion}.
- On the Parameters tab page, add releaseVersion and enable Runtime Settings.
Figure 2 Configuring the version parameter
- On the Basic Information tab page, change the task name to functions-deploy-build and click Save.
Creating a Deployment Task
- Choose Build & CloudArtifact > CloudDeploy, and click Create Task.
- Select Blank Template and click Next.
- Add only the Select Deployment Source action.
- Configure the Select Deployment Source action.
Figure 3 Configuring the Select Deployment Source action
- Host Group: Select deploy-function.
- Software package: Enter /functions-deploy-build/${releaseVersion}/deploy.py.
- Download Path: Enter /home/function/deploy.
- On the Parameters tab page, add releaseVersion and enable Runtime Settings.
Figure 4 Setting parameters
- On the Basic Information tab page, change the task name to update-function-deploy and click Save.
Configuring a Pipeline
- Choose Build & CloudArtifact > CloudPipeline, and click Create Pipeline.
- Select functions for Repository and Blank Template for the template.
- Configure Build and Check.
- Add a build task, and select the function-deploy-build task.
Figure 5 Adding a task
- Set releaseVersion as a pipeline parameter.
Figure 6 Setting releaseVersion
- Click Save.
- Add a build task, and select the function-deploy-build task.
- Configure a deployment task.
- Add a stage named Deploy after Build_and_Check, set Task Execution to Serial, and click Save.
Figure 7 Adding a stageFigure 8 Configuring the stage
- Click Add Task to add a deployment task named DeployScript, and select the update-function-deploy task.
Figure 9 Adding a taskFigure 10 Configuring the taskSet releaseVersion as a pipeline parameter.Figure 11 Setting releaseVersion
- Click Save.
- Add a stage named Deploy after Build_and_Check, set Task Execution to Serial, and click Save.
- On the Basic Information tab page, change the pipeline task name to pipeline-update-function-deploy and click Save.
- Execute the pipeline.
- Set the runtime parameter releaseVersion to 1.0.0 and click Execute.
- Wait till the deploy.py script is released.
Figure 12 Execution successful
Parent topic: Hosting Function Code with DevCloud
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot