1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[EXPERIMENTAL] Support upload option for s3 package hosting.

Example:
    $ ruby tool/make-snapshot -archname=snapshot -s3=tmp /tmp trunk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2018-02-27 14:08:26 +00:00
parent 2af1761466
commit a65b8864a6

View file

@ -6,6 +6,7 @@ require 'digest/sha2'
require 'fileutils'
require 'shellwords'
require 'tmpdir'
require 'pathname'
require File.expand_path("../vcs", __FILE__)
require File.expand_path("../colorize", __FILE__)
STDOUT.sync = true
@ -17,6 +18,7 @@ $keep_temp ||= nil
$patch_file ||= nil
$packages ||= nil
$digests ||= nil
$s3 ||= nil
$tooldir = File.expand_path("..", __FILE__)
$unicode_version = nil if ($unicode_version ||= nil) == ""
$colorize = Colorize.new
@ -37,6 +39,7 @@ options:
(#{SVNURL})
-git[=URL] make snapshot from GIT repository
(#{GITURL})
-s3=PATH s3 bucket path(default=tmp)
-help, --help show this message
version:
trunk, stable, branches/*, tags/*, X.Y, X.Y.Z, X.Y.Z-pL
@ -466,6 +469,11 @@ revisions.collect {|rev| package(vcs, rev, destdir, tmp)}.flatten.each do |name|
next
end
str = open(name, "rb") {|f| f.read}
if $s3
`aws s3 cp #{name} s3://ftp.r-l.o/pub/#{$s3}/#{Pathname(name).basename}`
FileUtils.rm_f name
name = "https://s3.amazonaws.com/ftp.r-l.o/pub/#{$s3}/#{Pathname(name).basename}"
end
puts "* #{$colorize.pass(name)}"
puts " SIZE: #{str.bytesize} bytes"
$digests.each do |alg|