Skip to content

Commit 26b4b57

Browse files
author
zhangliang
committed
Update readme
1 parent abbaa77 commit 26b4b57

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Diff for: README.md

+19
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,23 @@ SET ZONE=huadong
1515
SET BUCKET=nameimtest
1616
SET PREFIX=drone/
1717
SET PATH=e:\drone-qiniu
18+
```
19+
20+
## Usage
21+
```
22+
steps:
23+
- name: upload-static
24+
image: bysir/drone-qiniu:master
25+
pull: if-not-exists
26+
privileged: true
27+
settings:
28+
access_key:
29+
from_secret: qiniu_access_key
30+
SECRET_KEY:
31+
from_secret: qiniu_secret_key
32+
zone: huadong
33+
bucket: creght-sys
34+
prefix: render/
35+
path: ./internal/render/static
36+
1837
```

Diff for: lib/qiniu/upload.go

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package qiniu
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"path/filepath"
78
"strings"
@@ -26,7 +27,12 @@ type PutRsp struct {
2627

2728
// 上传一个文件夹
2829
func (u Uploader) UploadDir(zone *storage.Zone, bucket string, keyPrefix string, dirPath string) (err error) {
30+
fmt.Printf("upload dir: '%s' to bucket '%s', prefix: '%s'\n", dirPath, bucket, keyPrefix)
31+
2932
err = filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error {
33+
if err != nil {
34+
return err
35+
}
3036
if info.IsDir() {
3137
return nil
3238
}

0 commit comments

Comments
 (0)