1 Star 0 Fork 0

AlibabaCloud-FC / upload-oss-regions

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
readme.md 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
anycodes 提交于 2020-12-25 10:21 . init

批量上传到 OSS

yml 配置

UploadOssComponent:
  Component: upload-oss-regions
  Provider: alibaba
  # Access: wss # 密钥别名
  Properties:
    # Region: cn-shenzhen # 上传到指定的单个地区
    # Region: all # 上传到所有地区
    Region: # 上传到指定的多个地区
      - cn-shenzhen
      - cn-hangzhou
    Uri: ./zips # 制定要上传的文件夹
    BucketName: fc-console-gen-{region}-{accountId} # 指定上传的 bucket; 支持 {region} 和 {accountId} 写法
    ObjectPath: create-function-demo-code # 上传到 oss 的哪个目录下
    Ignore: # 指定哪些文件不上传
      - .DS_Store

BucketName 占位符

  • {region} 实际部署中转义成 bucket 所在的区域
  • {accountId} 实际部署中转义成主账号的 uid

Region: all 部署的地区

['cn-qingdao', 'cn-beijing', 'cn-zhangjiakou', 'cn-hangzhou', 'cn-shanghai', 'cn-shenzhen', 'cn-huhehaote', 'cn-hongkong', 'cn-chengdu', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'ap-southeast-3', 'ap-southeast-5', 'ap-northeast-1', 'us-west-1', 'us-east-1', 'eu-central-1', 'eu-west-1']

执行指令的参数

  • -y: 覆盖 ObjectPath 已经存在的文件
  • -n: 不上传 ObjectPath 已经存在的文件
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alibaba-cloud-fc/upload-oss-regions.git
git@gitee.com:alibaba-cloud-fc/upload-oss-regions.git
alibaba-cloud-fc
upload-oss-regions
upload-oss-regions
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891