Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.56 KB

使用s工具进行克隆函数.md

File metadata and controls

65 lines (46 loc) · 2.56 KB
title description position category
使用s工具进行克隆函数
使用s工具进行克隆函数
13
概述

使用s工具进行克隆函数

在s工具中有一个s sync命令,我们可以通过这个命令实现快速克隆函数。查看详情,也可以通过执行s cli fc sync -h查看帮助信息

Sync

  Synchronize online resources to offline resources 

Usage

  s sync <options>  
                    

Options

  -f, --force boolean      Mandatory overwrite code file                                                 
  --function-name string   Specify the alicloud fc function name.                                        
  --region string          Specify the region of alicloud.                                               
  --service-name string    Specify the alicloud fc service name.                                         
  --target-dir string      Specify storage directory(default: current dir)                               
  --trigger-name string    Specify the alicloud fc trigger name, you can set names by using multiple     
                           trigger-name option, eg: --trigger-name triggerA --trigger-name triggerB.     
  --type string            Operation type, code/config/all(default: all)                                 

Global Options

  -a, --access string   Specify key alias         
  --debug string        Output debug informations 
  -h, --help string     Help for command.         

Examples with Yaml

  $ s sync                                                        
  $ s <ProjectName> sync                                          
  $ s sync --region cn-hangzhou --service-name myService          
  $ s exec -- sync  --region cn-hangzhou --service-name myService 

Examples with CLI

  $ s cli fc sync --region cn-shanghai --service-name myService --type config 

示例

  • 我们先部署一个名为sync-test的函数
  • 执行s sync命令进行克隆函数
s cli fc sync --region cn-hangzhou --service-name sync-test --function-name sync-test -a default

  • 更改functionName为sync-clone,并执行s deploy重新部署函数

至此,整个克隆示例完成