Files

73 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2020-12-24 11:09:31 +08:00
# GoCOS
2020-12-25 11:39:38 +08:00
2025-12-02 10:59:25 +08:00
通过Gitea/Drone CI上传文件到腾讯云对象存储
2020-12-24 10:36:26 +08:00
2025-12-02 11:16:27 +08:00
# Gitea配置例子
2025-12-02 11:29:12 +08:00
2025-12-02 11:16:27 +08:00
```yaml
2025-12-02 11:29:12 +08:00
on: [ push, workflow_dispatch ]
2025-12-02 11:16:27 +08:00
jobs:
default:
2025-12-02 11:28:36 +08:00
runs-on: ubuntu-latest
2025-12-02 11:16:27 +08:00
steps:
- name: checkout
uses: actions/checkout@v6
- name: upload to cos
2025-12-02 12:26:29 +08:00
uses: xiaoqidun/gocos@main
2025-12-02 11:16:27 +08:00
with:
2025-12-02 11:41:16 +08:00
secret_id: ${{ secrets.secret_id }}
secret_key: ${{ secrets.secret_key }}
bucket_url: ${{ secrets.bucket_url }}
2025-12-02 11:16:27 +08:00
source_path: build/release
target_path: build/release
strip_prefix: build/release
```
2025-12-02 11:08:29 +08:00
# Drone配置例子
2020-12-25 11:39:38 +08:00
2020-12-24 10:36:26 +08:00
```yml
kind: pipeline
type: docker
name: default
steps:
2025-12-02 11:16:27 +08:00
- name: upload to cos
2025-12-02 10:35:46 +08:00
image: ccr.ccs.tencentyun.com/xiaoqidun/gocos:latest
2020-12-25 11:39:38 +08:00
settings:
secret_id:
from_secret: secret_id
secret_key:
from_secret: secret_key
bucket_url:
from_secret: bucket_url
source_path: build/release
target_path: build/release
2020-12-25 11:39:38 +08:00
strip_prefix: build/release
2020-12-24 10:36:26 +08:00
```
2020-12-24 11:05:03 +08:00
2025-12-02 11:28:36 +08:00
# 输入参数说明
2020-12-25 11:39:38 +08:00
2020-12-24 11:08:32 +08:00
### secret_id
2020-12-25 11:39:38 +08:00
2020-12-24 11:16:34 +08:00
API密钥管理获得的SecretId
2020-12-24 11:05:03 +08:00
2020-12-24 11:08:32 +08:00
### secret_key
2020-12-25 11:39:38 +08:00
2020-12-24 11:16:34 +08:00
API密钥管理获得的SecretKey
2020-12-24 11:05:03 +08:00
2020-12-24 11:08:32 +08:00
### bucket_url
2020-12-25 11:39:38 +08:00
2020-12-24 11:05:03 +08:00
存储桶概览中的访问域名
### source_path
2020-12-25 11:39:38 +08:00
2025-12-02 10:35:46 +08:00
构建环境中文件的源位置
2020-12-24 11:05:03 +08:00
### target_path
2020-12-25 11:39:38 +08:00
2020-12-24 11:05:03 +08:00
存储桶中文件的目标位置
2020-12-24 11:08:32 +08:00
### strip_prefix
2020-12-25 11:39:38 +08:00
2020-12-24 11:05:03 +08:00
从文件的源位置剔除前缀