@@ -161,6 +161,7 @@ class DocsCLI < Thor
161161 desc 'upload' , '[private]'
162162 option :dryrun , type : :boolean
163163 option :packaged , type : :boolean
164+ option :rclone , type : :boolean
164165 def upload ( *names )
165166 if options [ :packaged ]
166167 slugs = Dir [ File . join ( Docs . store_path , '*.tar.gz' ) ] . map { |f | File . basename ( f , '.tar.gz' ) }
@@ -190,6 +191,11 @@ class DocsCLI < Thor
190191 puts "[S3] Syncing #{ doc . path } ..."
191192 cmd = "aws s3 sync #{ File . join ( Docs . store_path , doc . path ) } s3://devdocs-documents/#{ doc . path } --delete --profile devdocs"
192193 cmd << ' --dryrun' if options [ :dryrun ]
194+ if options [ :packaged ]
195+ puts "[S3] Syncing #{ doc . path } using rclone..."
196+ cmd = "rclone sync #{ File . join ( Docs . store_path , doc . path ) } devdocs:devdocs-documents/#{ doc . path } --delete-after --progress"
197+ cmd << ' --dry-run' if options [ :dryrun ]
198+ end
193199 system ( cmd )
194200 end
195201 puts '[S3] Done syncing.'
@@ -202,6 +208,11 @@ class DocsCLI < Thor
202208 puts "[S3 bundle] Uploading #{ filename } ..."
203209 cmd = "aws s3 cp #{ File . join ( Docs . store_path , filename ) } s3://devdocs-downloads/#{ filename } --profile devdocs"
204210 cmd << ' --dryrun' if options [ :dryrun ]
211+ if options [ :packaged ]
212+ puts "[S3 bundle] Uploading #{ filename } using rclone..."
213+ cmd = "rclone copy #{ File . join ( Docs . store_path , filename ) } devdocs:devdocs-downloads/"
214+ cmd << ' --dry-run' if options [ :dryrun ]
215+ end
205216 system ( cmd )
206217 end
207218 puts '[S3 bundle] Done uploading.'
0 commit comments