summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 14:08:26 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 14:08:26 +0000
commita65b8864a6d940df3b01ac4bd9c04fd47b4972d0 (patch)
treeccb61988bc9e5cfa43fad1d657ff333a3c92e57b /tool/make-snapshot
parent2af1761466890a7621d908b0b4b0b19560543ba2 (diff)
[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
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot8
1 files changed, 8 insertions, 0 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 1052487000..6003fb1b4e 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -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|