From a65b8864a6d940df3b01ac4bd9c04fd47b4972d0 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 27 Feb 2018 14:08:26 +0000 Subject: [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 --- tool/make-snapshot | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tool') 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| -- cgit v1.2.3