mirror of
https://github.com/rainerosion/drone-upyun-cos-plugins.git
synced 2026-06-02 18:33:43 +08:00
docker supported
This commit is contained in:
parent
61e08d0060
commit
72745885e0
4
Dockerfile
Normal file
4
Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM alpine:latest
|
||||
LABEL authors="rainerosion@gmail.com"
|
||||
COPY upcos /bin/upcos
|
||||
ENTRYPOINT ["upcos"]
|
||||
6
cos.go
6
cos.go
@ -38,8 +38,12 @@ func main() {
|
||||
resume := &upyun.MemoryRecorder{}
|
||||
// 若设置为 nil,则为正常的分片上传
|
||||
yun.SetRecorder(resume)
|
||||
separator := "/"
|
||||
for _, path := range fileList {
|
||||
remotePath := remoteBasePath + "/" + path
|
||||
if strings.HasPrefix(path, "/") {
|
||||
separator = ""
|
||||
}
|
||||
remotePath := remoteBasePath + separator + path
|
||||
err = yun.Put(&upyun.PutObjectConfig{
|
||||
Path: remotePath,
|
||||
LocalPath: path,
|
||||
|
||||
19
readme.md
19
readme.md
@ -2,11 +2,24 @@
|
||||
|
||||
## 参数说明
|
||||
| 参数 | 说明 | 备注 |
|
||||
| ---------------- |----------|--------|
|
||||
| ---------------- |--------|-------------|
|
||||
| up_operator | 操作员名称 | |
|
||||
| up_password | 操作员密码 | |
|
||||
| up_bucket | bucket名称 | 服务名称 |
|
||||
| up_bucket | bucket | 服务名称 |
|
||||
| local_base_path | 本地路径 | 文件或文件夹 |
|
||||
| remote_base_path | 对象存储路径 | 文件夹 |
|
||||
| remote_base_path | 对象存储路径 | 文件存放路径(文件夹) |
|
||||
|
||||
## 使用方式
|
||||
````yaml
|
||||
- name: upload-upyun
|
||||
image: rainteam/upcos:latest
|
||||
settings:
|
||||
up_operator:
|
||||
from_secret: up_operator
|
||||
up_password:
|
||||
from_secret: up_password
|
||||
up_bucket:
|
||||
from_bucket: up_bucket
|
||||
local_base_path: wechatbot
|
||||
remote_base_path: gitea/devops
|
||||
````
|
||||
Loading…
Reference in New Issue
Block a user