Kouhei Sutou
null+****@clear*****
Sun Sep 14 17:38:01 JST 2014
Kouhei Sutou 2014-05-19 23:00:24 +0900 (Mon, 19 May 2014) New Revision: e5a153c994685c7886f8eb0845ebcfef949601d5 https://github.com/groonga/heroku-groonga-builder/commit/e5a153c994685c7886f8eb0845ebcfef949601d5 Message: Upload built archive Modified files: Rakefile Modified: Rakefile (+17 -1) =================================================================== --- Rakefile 2014-05-19 22:58:52 +0900 (9a57632) +++ Rakefile 2014-05-19 23:00:24 +0900 (3688872) @@ -1,4 +1,5 @@ require "pathname" +require "net/http" task :default => :build @@ -19,5 +20,20 @@ task :build do sh("make", "install") end - sh("tar", "cJf", "heroku-#{base_name}.tar.xz", "vendor/groonga") + built_archive_name = "heroku-#{base_name}.tar.xz" + sh("tar", "cJf", built_archive_name, "vendor/groonga") + + upload_base_url = ENV["UPLOAD_BASE_URL"] + upload_base_url ||= "http://groonga-builder.herokuapp.com" + upload_url = "#{upload_base_url}/#{built_archive_name}" + uri = URI(upload_url) + Net::HTTP.start(uri.host, uri.port) do |http| + response = File.open(built_archive_name, "rb") do |archive| + request = Net::HTTP::Put.new + request.body = archive + http.request(request) + end + puts(response.code) + puts(response.body) + end end -------------- next part -------------- HTML����������������������������... Download