Use Apsara DevOps Pipeline to deploy functions

更新时间:
复制 MD 格式

Function Compute integrates with Apsara DevOps Pipeline to enable automatic function deployment. This topic describes how to run a pipeline to automatically deploy code to a specific function. This example uses a ZIP code package in an OSS bucket as the deployment source.

Prerequisites

Procedure

Step 1: Create a pipeline

  1. Log on to the Apsara DevOps Pipeline console. On the My Pipelines page, click Create Pipeline.

  2. In the dialog box that appears, select a preset Apsara DevOps template, and then click Create. This example uses the empty template.

Step 2: Configure the pipeline to deploy to Function Compute

  1. Click the Empty Task node. In the Edit panel on the right, configure the parameters.

    The key parameters are described below. Use the default values for all other parameters.

    Parameter Name

    Description

    Task Name

    Enter a custom task name for easy management and maintenance. For example, Deploy to Function Compute from an OSS code source.

    Build Environment

    Select a container environment.

    Task Steps

    Choose Add Step > Publish > Alibaba Cloud Function Compute Deployment. Follow the on-screen instructions to select the region and name of the function. Then, select OSS ZIP file to specify the location of the code package.

    imageimage

  2. In the upper-right corner, click Save and Run.

Step 3: View the pipeline task

  1. After the pipeline task is complete, click Logs to view the execution process and results.

  2. To update the function code later, find the pipeline in the Apsara DevOps Pipeline console. Then, click the run icon to the right of the pipeline name.