Skip to content

Commit

Permalink
Use curl
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed May 19, 2014
1 parent 53be120 commit d71a365
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require "pathname"
require "net/http"

task :default => :build

task :build do
Expand Down Expand Up @@ -30,14 +27,8 @@ task :build do
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
sh("curl",
"--request", "PUT",
"--data-binary", "@#{built_archive_name}",
upload_url)
end

0 comments on commit d71a365

Please sign in to comment.