跳转到内容

cnb-rs asset upload ​

cnb-rs asset upload [flags]

上传本地文件到指定 Commit 作为附件。

通过 commit 引用定位,获取上传 URL 后将文件上传至对象存储,最后确认上传完成。

选项 ​

  • -s, --sha1 <SHA1>: commit SHA(支持短 SHA / 分支 / tag;必填)
  • -f, --file <FILE>: 要上传的本地文件路径(必填)

继承的全局选项:

  • --repo <REPO>: 指定仓库路径(格式:group/repo)
  • --domain <DOMAIN>: 指定目标域名(默认:cnb.cool)

示例 ​

bash
# 按分支名上传文件到指定 Commit
$ cnb-rs asset upload --sha1 main --file dist/app.zip
文件 app.zip 已上传到 Commit main

# 简写(注意 `--sha1` 现在没有短 flag,只有 `-f/--file`)
$ cnb-rs asset upload --sha1 abc123def456 -f ./build/output.tar.gz

另请参阅 ​

Released under the MIT License.