Commit b2ee20a17ae55c002c6eecf63c9c3b654530ee6e

Authored by Joenio Costa
Committed by Macartur Sousa
1 parent f861ffd8
Exists in fix_sign_up_form

Elasticsearch: Refactored plugin structure.

Rakefile to download and install elasticsearch
Adding rubygems.org as source for Gemfile
Removing trailing whitespace
Updating install instructions
Elasticsearch depends on openjdk-7-jdk
plugins/elasticsearch/Gemfile
  1 +source 'https://rubygems.org'
  2 +
1 gem 'elasticsearch-model' 3 gem 'elasticsearch-model'
2 -gem 'elasticsearch-rails' 4 +gem 'elasticsearch-rails'
plugins/elasticsearch/README.md
@@ -10,20 +10,27 @@ Download: https://www.elastic.co/downloads/past-releases/elasticsearch-1-7-5 @@ -10,20 +10,27 @@ Download: https://www.elastic.co/downloads/past-releases/elasticsearch-1-7-5
10 INSTALL 10 INSTALL
11 ======= 11 =======
12 12
13 -Install dependencies 13 +Install elasticsearch and openjdk-7-jdk.
14 14
15 -Install elasticsearch package and start service.  
16 -By default, the service runs on port 9200 15 + $ cd plugins/elasticsearch
  16 + $ rake install
17 17
18 -Install gems listed in plugin Gemfile. If this step fail, just copy the gems to core Gemfile  
19 -and run the command 'bundle install' 18 +After install start the service, by default, the service runs on port 9200.
  19 +
  20 +Install gems listed in plugin Gemfile.
  21 +
  22 + $ cd plugins/elasticsearch
  23 + $ bundle install
  24 +
  25 +If this step fail, just copy the gems to core Gemfile and run the command
  26 +'bundle install'.
20 27
21 Enable plugin 28 Enable plugin
22 ------------- 29 -------------
23 30
24 Execute the command to enable Elasticsearch Plugin at your noosfero: 31 Execute the command to enable Elasticsearch Plugin at your noosfero:
25 32
26 -./script/noosfero-plugins enable elasticsearch 33 + $ ./script/noosfero-plugins enable elasticsearch
27 34
28 Active plugin 35 Active plugin
29 ------------- 36 -------------
plugins/elasticsearch/Rakefile 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 +#!/usr/bin/env rake
  2 +
  3 +require 'open-uri'
  4 +
  5 +desc "download elasticsearch"
  6 +task :download do
  7 + unless File.exists? '/tmp/elasticsearch.deb'
  8 + puts "downloading elasticsearch Debian package..."
  9 + download = open('https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.5.deb')
  10 + IO.copy_stream(download, '/tmp/elasticsearch.deb')
  11 + end
  12 +end
  13 +
  14 +desc "install elasticsearch"
  15 +task :install => :download do
  16 + sh 'sudo apt-get install openjdk-7-jdk'
  17 + sh 'sudo dpkg -i /tmp/elasticsearch.deb || sudo apt-get install -f'
  18 +end