Skip to content
Browse files

Make groonga binaries uploadable via rake task

  • Loading branch information...
1 parent 83df821 commit d3bdb06de0b666e72bd27bbcdd41e6a233ae9021 @darashi darashi committed Nov 28, 2012
Showing with 78 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 Gemfile
  3. +58 −0 Gemfile.lock
  4. +15 −6 Rakefile
View
1 .gitignore
@@ -0,0 +1 @@
+.github-upload-token
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem "github_downloads"
+gem "vulcan"
View
58 Gemfile.lock
@@ -0,0 +1,58 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.3.2)
+ excon (0.16.10)
+ faraday (0.8.4)
+ multipart-post (~> 1.1)
+ github_api (0.8.1)
+ faraday (~> 0.8.1)
+ hashie (~> 1.2.0)
+ multi_json (~> 1.3)
+ nokogiri (~> 1.5.2)
+ oauth2
+ github_downloads (0.1.3)
+ github_api (~> 0.6)
+ rest-client (~> 1.6)
+ hashie (1.2.0)
+ heroku (2.33.2)
+ heroku-api (~> 0.3.7)
+ launchy (>= 0.3.2)
+ netrc (~> 0.7.7)
+ rest-client (~> 1.6.1)
+ rubyzip
+ heroku-api (0.3.7)
+ excon (~> 0.16.10)
+ httpauth (0.2.0)
+ jwt (0.1.5)
+ multi_json (>= 1.0)
+ launchy (2.1.2)
+ addressable (~> 2.3)
+ mime-types (1.19)
+ multi_json (1.3.7)
+ multipart-post (1.1.5)
+ netrc (0.7.7)
+ nokogiri (1.5.5)
+ oauth2 (0.8.0)
+ faraday (~> 0.8)
+ httpauth (~> 0.1)
+ jwt (~> 0.1.4)
+ multi_json (~> 1.0)
+ rack (~> 1.2)
+ rack (1.4.1)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ rubyzip (0.9.9)
+ thor (0.14.6)
+ vulcan (0.8.0)
+ heroku (>= 2.26.0, < 3.0)
+ multipart-post (~> 1.1.3)
+ rest-client (~> 1.6.7)
+ thor (~> 0.14.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ github_downloads
+ vulcan
View
21 Rakefile
@@ -1,24 +1,33 @@
+require 'bundler'
require 'fileutils'
require 'tmpdir'
+Bundler.require
+
task :default => :groonga
-GROONGA_VERSION = '2.0.8'
+GROONGA_VERSION = '2.0.9'
desc 'Build groonga'
task :groonga do
+ uploader = GithubDownloads::Uploader.new
+ uploader.authorize
+
source_url = "http://packages.groonga.org/source/groonga/groonga-#{GROONGA_VERSION}.tar.gz"
- built_binary = nil
Dir.mktmpdir('groonga-') do |tmpdir|
+ target_filename = "groonga-#{GROONGA_VERSION}.tgz"
+
+ # build
Dir.chdir(tmpdir) do |dir|
sh "curl #{source_url} -s -o - | tar zxf -"
- sh "vulcan build -v -o groonga-#{GROONGA_VERSION}.tgz --prefix /app/vendor/groonga --source groonga-#{GROONGA_VERSION}"
+ sh "vulcan build -v -o #{target_filename} --prefix /app/vendor/groonga --source groonga-#{GROONGA_VERSION}"
- built_binary = File.join(tmpdir, "groonga-#{GROONGA_VERSION}.tgz")
end
+ built_binary_path = File.join(tmpdir, "groonga-#{GROONGA_VERSION}.tgz")
- FileUtils.cp(built_binary, '.')
- # TODO upload it to github
+ # upload it to github
+ puts "Uploading #{built_binary_path}"
+ uploader.upload_file(target_filename, "groonga #{GROONGA_VERSION}", built_binary_path)
end
end

0 comments on commit d3bdb06

Please sign in to comment.
Something went wrong with that request. Please try again.