File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,20 @@ func_repo_clone() {
73
73
# ${1} - bucket name
74
74
# ${2} - COS path
75
75
# ${3} - target path
76
- coscli -e " ${VAR_COS_ENDPOINT} " cp -r " cos://${1} /packages/${2} " " ${3} "
76
+
77
+ # --part-size indicates the file chunk size.
78
+ # when the file is larger than --part-size, coscli will chunk the file by --part-size.
79
+ # when uploading/downloading the file in chunks, it will enable breakpoint transfer by default,
80
+ # which will generate cosresumabletask file and interfere with the file integrity.
81
+ # ref: https://cloud.tencent.com/document/product/436/63669
82
+ coscli -e " ${VAR_COS_ENDPOINT} " cp -r --part-size 1000 " cos://${1} /packages/${2} " " ${3} "
77
83
}
78
84
79
85
func_repo_backup () {
80
86
# ${1} - bucket name
81
87
# ${2} - COS path
82
88
# ${3} - backup tag
83
- coscli -e " ${VAR_COS_ENDPOINT} " cp -r " cos://${1} /packages/${2} " " cos://${1} /packages/backup/${2} _${3} "
89
+ coscli -e " ${VAR_COS_ENDPOINT} " cp -r --part-size 1000 " cos://${1} /packages/${2} " " cos://${1} /packages/backup/${2} _${3} "
84
90
}
85
91
86
92
func_repo_backup_remove () {
@@ -110,15 +116,15 @@ func_repo_upload() {
110
116
# ${2} - bucket name
111
117
# ${3} - COS path
112
118
coscli -e " ${VAR_COS_ENDPOINT} " rm -r -f " cos://${2} /packages/${3} " || true
113
- coscli -e " ${VAR_COS_ENDPOINT} " cp -r " ${1} " " cos://${2} /packages/${3} "
119
+ coscli -e " ${VAR_COS_ENDPOINT} " cp -r --part-size 1000 " ${1} " " cos://${2} /packages/${3} "
114
120
}
115
121
116
122
func_repo_publish () {
117
123
# ${1} - CI bucket
118
124
# ${2} - repo publish bucket
119
125
# ${3} - COS path
120
126
coscli -e " ${VAR_COS_ENDPOINT} " rm -r -f " cos://${2} /packages/${3} " || true
121
- coscli -e " ${VAR_COS_ENDPOINT} " cp -r " cos://${1} /packages/${3} " " cos://${2} /packages/${3} "
127
+ coscli -e " ${VAR_COS_ENDPOINT} " cp -r --part-size 1000 " cos://${1} /packages/${3} " " cos://${2} /packages/${3} "
122
128
}
123
129
124
130
# =======================================
You can’t perform that action at this time.
0 commit comments