Skip to content

Instantly share code, notes, and snippets.

@powdahound
Created August 13, 2010 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save powdahound/523606 to your computer and use it in GitHub Desktop.
Save powdahound/523606 to your computer and use it in GitHub Desktop.
# installs couchdb-lucene (http://github.com/rnewson/couchdb-lucene)
include_recipe "couchdb"
version = node[:couchdb][:lucene][:version]
file = "couchdb-lucene-#{version}-dist.tar.gz"
install_dir = "/opt/couchdb-lucene-#{version}"
# Install couchdb-lucene
script "install_couchdb-lucene" do
interpreter "bash"
user "root"
cwd "/tmp"
code <<-EOH
rm -r couchdb-lucene-#{version}
wget http://github.com/downloads/rnewson/couchdb-lucene/#{file}
tar zxf #{file}
mv couchdb-lucene-#{version} #{install_dir}
chown -R couchdb:couchdb #{install_dir}
EOH
not_if do
File.exists? install_dir
end
end
# Configure CouchDB
template "/usr/local/etc/couchdb/local.d/lucene.ini" do
source "lucene.ini.erb"
mode "0644"
notifies :restart, resources(:service => "couchdb")
variables(
:install_dir => install_dir
)
end
# Install runit scripts
include_recipe "runit"
runit_service "couchdb-lucene" do
options({
:install_dir => install_dir
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment