[Groonga-commit] groonga/heroku-buildpack-groonga [master] Make groonga binaries uploadable via rake task

アーカイブの一覧に戻る

Yoji SHIDARA null+****@clear*****
Wed Nov 28 17:34:48 JST 2012


Yoji SHIDARA	2012-11-28 17:34:48 +0900 (Wed, 28 Nov 2012)

  New Revision: d3bdb06de0b666e72bd27bbcdd41e6a233ae9021
  https://github.com/groonga/heroku-buildpack-groonga/commit/d3bdb06de0b666e72bd27bbcdd41e6a233ae9021

  Log:
    Make groonga binaries uploadable via rake task

  Added files:
    .gitignore
    Gemfile
    Gemfile.lock
  Modified files:
    Rakefile

  Added: .gitignore (+1 -0) 100644
===================================================================
--- /dev/null
+++ .gitignore    2012-11-28 17:34:48 +0900 (948d68e)
@@ -0,0 +1 @@
+.github-upload-token

  Added: Gemfile (+4 -0) 100644
===================================================================
--- /dev/null
+++ Gemfile    2012-11-28 17:34:48 +0900 (50f9997)
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem "github_downloads"
+gem "vulcan"

  Added: Gemfile.lock (+58 -0) 100644
===================================================================
--- /dev/null
+++ Gemfile.lock    2012-11-28 17:34:48 +0900 (2b4601c)
@@ -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

  Modified: Rakefile (+15 -6)
===================================================================
--- Rakefile    2012-11-28 17:04:42 +0900 (bf8fe72)
+++ Rakefile    2012-11-28 17:34:48 +0900 (9643e7d)
@@ -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
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る