[前][次][番号順一覧][スレッド一覧]

ruby-changes:50467

From: hsbt <ko1@a...>
Date: Tue, 27 Feb 2018 23:08:32 +0900 (JST)
Subject: [ruby-changes:50467] hsbt:r62596 (trunk): [EXPERIMENTAL] Support upload option for s3 package hosting.

hsbt	2018-02-27 23:08:26 +0900 (Tue, 27 Feb 2018)

  New Revision: 62596

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62596

  Log:
    [EXPERIMENTAL] Support upload option for s3 package hosting.
    
      Example:
        $ ruby tool/make-snapshot -archname=snapshot -s3=tmp /tmp trunk

  Modified files:
    trunk/tool/make-snapshot
Index: tool/make-snapshot
===================================================================
--- tool/make-snapshot	(revision 62595)
+++ tool/make-snapshot	(revision 62596)
@@ -6,6 +6,7 @@ require 'digest/sha2' https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L6
 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 https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L18
 $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: https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L39
                         (#{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, re https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L469
     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|

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]