Yoji SHIDARA
null+****@clear*****
Wed Nov 28 13:25:19 JST 2012
Yoji SHIDARA 2012-11-28 13:25:19 +0900 (Wed, 28 Nov 2012) New Revision: 34fc00e766f039e7daf86607c79b607693efdb8b https://github.com/groonga/heroku-buildpack-groonga/commit/34fc00e766f039e7daf86607c79b607693efdb8b Log: Initial commit Added files: REDAME.md Rakefile bin/compile bin/detect bin/release Added: REDAME.md (+11 -0) 100644 =================================================================== --- /dev/null +++ REDAME.md 2012-11-28 13:25:19 +0900 (9c2f187) @@ -0,0 +1,11 @@ +# Heroku buildpack: groonga + +This is a Heroku buildpack of groonga(http://groonga.org/). + +## Usage: + + heroku create --stack cedar --buildpack https://github.com/groonga/heroku-buildpack-groonga.git + +Create `data.grn` on the root of your project and push it to heroku. + + git push heroku master Added: Rakefile (+24 -0) 100644 =================================================================== --- /dev/null +++ Rakefile 2012-11-28 13:25:19 +0900 (bf8fe72) @@ -0,0 +1,24 @@ +require 'fileutils' +require 'tmpdir' + +task :default => :groonga + +GROONGA_VERSION = '2.0.8' + +desc 'Build groonga' +task :groonga do + source_url = "http://packages.groonga.org/source/groonga/groonga-#{GROONGA_VERSION}.tar.gz" + + built_binary = nil + Dir.mktmpdir('groonga-') do |tmpdir| + 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}" + + built_binary = File.join(tmpdir, "groonga-#{GROONGA_VERSION}.tgz") + end + + FileUtils.cp(built_binary, '.') + # TODO upload it to github + end +end Added: bin/compile (+19 -0) 100755 =================================================================== --- /dev/null +++ bin/compile 2012-11-28 13:25:19 +0900 (5bc834d) @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# bin/compile <build-dir> <cache-dir> + +GROONGA_VERSION=2.0.8 + +echo "-----> Installing groonga $VERSION" + +cd $1 + +curl http://cloud.github.com/downloads/groonga/heroku-buildpack-groonga/groonga-$GROONGA_VERSION.tgz -s -O +mkdir -p vendor/groonga +tar -C vendor/groonga -xf groonga-$GROONGA_VERSION.tgz +rm groonga-$GROONGA_VERSION.tgz + +export PATH=$PATH:$1/vendor/groonga/bin +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$1/vendor/groonga/lib + +echo "-----> Loading data.grn" +groonga --file data.grn -n database Added: bin/detect (+8 -0) 100755 =================================================================== --- /dev/null +++ bin/detect 2012-11-28 13:25:19 +0900 (c98e3eb) @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# bin/detect <build-dir> + +if [ -f $1/data.grn ]; then + echo "groonga" && exit 0 +else + echo "no" && exit 1 +fi Added: bin/release (+9 -0) 100755 =================================================================== --- /dev/null +++ bin/release 2012-11-28 13:25:19 +0900 (17b4e09) @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +echo "---" +echo "addons:" +echo "config_vars:" +echo " PATH: $PATH:/app/vendor/groonga/bin" +echo " LD_LIBRARY_PATH: $LD_LIBRARY_PATH:/app/vendor/groonga/lib" +echo "default_process_types:" +echo " web: groonga -s --protocol http -p \$PORT database" -------------- next part -------------- HTML����������������������������... 下载