[Groonga-commit] groonga/heroku-groonga-builder at ef902fe [master] Extract as tasks

Back to archive index

Kouhei Sutou null+****@clear*****
Thu May 22 19:46:26 JST 2014


Kouhei Sutou	2014-05-22 19:46:26 +0900 (Thu, 22 May 2014)

  New Revision: ef902fe3763062dac904926dd7c38b10fa7b61fc
  https://github.com/groonga/heroku-groonga-builder/commit/ef902fe3763062dac904926dd7c38b10fa7b61fc

  Message:
    Extract as tasks

  Modified files:
    Rakefile

  Modified: Rakefile (+26 -13)
===================================================================
--- Rakefile    2014-05-22 00:14:20 +0900 (e275819)
+++ Rakefile    2014-05-22 19:46:26 +0900 (b28cdc4)
@@ -1,6 +1,30 @@
 task :default => :build
 
-task :build do
+task :go do
+  go_version = "1.2.2"
+  go_archive_name = "go#{go_version}.linux-amd64.tar.gz"
+  sh("curl", "-O", "https://storage.googleapis.com/golang/#{go_archive_name}")
+  sh("tar", "xf", go_archive_name)
+
+  go_root = File.join(Dir.pwd, "go")
+  ENV["GOROOT"] = go_root
+  go_path = File.join(Dir.pwd, "work", "go")
+  mkdir_p(go_path)
+  ENV["GOPATH"] = go_path
+
+  paths = [
+    go_path,
+    go_root,
+    ENV["PATH"],
+  ]
+  ENV["PATH"] = paths.join(File::PATH_SEPARATOR)
+end
+
+task :github_release => :go do
+  sh("go", "get", "github.com/aktau/github-release")
+end
+
+task :build => :github_release do
   if ENV["GITHUB_TOKEN"].nil?
     raise "must set GITHUB_TOKEN environment variable"
   end
@@ -28,18 +52,7 @@ task :build do
   built_archive_name = "heroku-#{base_name}.tar.xz"
   sh("tar", "cJf", built_archive_name, "vendor/groonga")
 
-  go_version = "1.2.2"
-  go_archive_name = "go#{go_version}.linux-amd64.tar.gz"
-  sh("curl", "-O", "https://storage.googleapis.com/golang/#{go_archive_name}")
-  sh("tar", "xf", go_archive_name)
-
-  go_root = File.join(Dir.pwd, "go")
-  ENV["GOROOT"] = go_root
-  go_path = File.join(Dir.pwd, "work", "go")
-  mkdir_p(go_path)
-  ENV["GOPATH"] = go_path
-  sh(File.join(go_root, "go"), "get", "github.com/aktau/github-release")
-  sh(File.join(go_path, "github-release"),
+  sh("github-release",
      "upload",
      "--user", "groonga",
      "--repo", "groonga",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index