forked from rubber/rubber
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:wr0ngway/rubber
- Loading branch information
Showing
19 changed files
with
235 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
roles: | ||
apache: | ||
packages: [apache2] | ||
packages: [apache2, libapache2-mod-proxy-html, libcurl4-openssl-dev, libapache2-mod-xsendfile] | ||
web_tools: | ||
packages: [libapache2-mod-proxy-html] | ||
packages: [apache2, libapache2-mod-proxy-html, libcurl4-openssl-dev, libapache2-mod-xsendfile] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% | ||
@path = "#{Rubber.root}/config/sunspot.yml" | ||
@additive = ["#prod_start", "#prod_end"] | ||
%> <% rubber_instances.for_role('solr').each do |ic| %> | ||
production: | ||
solr: | ||
hostname: <%= ic.external_host %> | ||
port: 8080 | ||
log_level: WARNING | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# installs, starts and stops solr | ||
# | ||
# * installation is ubuntu specific | ||
# * start and stop tasks are using the thinking sphinx plugin | ||
|
||
namespace :rubber do | ||
|
||
namespace :solr do | ||
|
||
rubber.allow_optional_tasks(self) | ||
|
||
after "rubber:install_packages", "rubber:solr:custom_install" | ||
|
||
desc "custom installing java and solr" | ||
task :custom_install, :roles => :solr do | ||
|
||
upload rubber_env.jdk_path, "/tmp/#{rubber_env.jdk}" | ||
upload rubber_env.solr_xml_path, "/tmp/#{rubber_env.solr_xml}" | ||
upload rubber_env.tarz_config_files, "/tmp/solr_conf.tar.gz" | ||
rubber.sudo_script 'install_java_solr', <<-ENDSCRIPT | ||
if [ ! -d "/usr/lib/jvm/jdk1.7" ]; then | ||
echo 'installing oracle java' | ||
tar -zxf /tmp/#{rubber_env.jdk} -C /tmp | ||
sudo mkdir -p /usr/lib/jvm/jdk1.7 | ||
mv -f /tmp/jdk1.7.0_10/* /usr/lib/jvm/jdk1.7/ | ||
echo 'updating java alterlative' | ||
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7/bin/java" 1 | ||
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7/bin/javac" 1 | ||
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7/bin/javaws" 1 | ||
echo 'installing tomcat' | ||
curl -o /tmp/apache-tomcat-7.0.34.tar.gz http://ftp.heanet.ie/mirrors/www.apache.org/dist/tomcat/tomcat-7/v7.0.34/bin/apache-tomcat-7.0.34.tar.gz | ||
tar -zxf /tmp/apache-tomcat-7.0.34.tar.gz -C #{rubber_env.tomcat_dest_folder} | ||
rm /tmp/apache-tomcat-7.0.34.tar.gz | ||
echo 'installing solr' | ||
curl -o /tmp/apache-solr-4.0.0.tgz http://ftp.heanet.ie/mirrors/www.apache.org/dist/lucene/solr/4.0.0/apache-solr-4.0.0.tgz | ||
tar -zxf /tmp/apache-solr-4.0.0.tgz -C /tmp | ||
cp /tmp/apache-solr-4.0.0/dist/apache-solr-4.0.0.war /mnt/apache-tomcat-7.0.34/webapps/solr.war | ||
rm -fr /tmp/apache-solr-4.0.0* | ||
echo 'setting up solr' | ||
mkdir -p #{rubber_env.solr_home_dest_foler}/solr/data | ||
mkdir -p #{rubber_env.solr_home_dest_foler}/solr/#{rubber_env.core_name} | ||
tar -zxf /tmp/solr_conf.tar.gz -C /mnt/solr/#{rubber_env.core_name} | ||
mv /tmp/#{rubber_env.solr_xml} #{rubber_env.solr_home_dest_foler}/solr | ||
rm /tmp/solr_conf.tar.gz | ||
fi | ||
ENDSCRIPT | ||
end | ||
|
||
|
||
def set_java_opts | ||
"export JAVA_OPTS='-server -Xmx#{rubber_env.Xmx} -Dsolr.data.dir=#{rubber_env.solr_home_dest_foler}/solr/data -Dsolr.solr.home=#{rubber_env.solr_home_dest_foler}/solr'" | ||
end | ||
|
||
desc "start solr" | ||
task :start_solr, :roles => :solr do | ||
rubber.sudo_script 'start_solr', <<-ENDSCRIPT | ||
echo 'starting tomcat' | ||
#{set_java_opts} | ||
nohup #{rubber_env.tomcat_dest_folder}/apache-tomcat-7.0.34/bin/startup.sh & | ||
sleep 5 | ||
ENDSCRIPT | ||
end | ||
|
||
desc "stop solr" | ||
task :stop_solr, :roles => :solr do | ||
rubber.sudo_script 'stop_solr', <<-ENDSCRIPT | ||
echo 'stoping tomcat' | ||
#{set_java_opts} | ||
#{rubber_env.tomcat_dest_folder}/apache-tomcat-7.0.34/bin/shutdown.sh | ||
ENDSCRIPT | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
jdk: JDK_TAR_GZ_FILE_NAME | ||
jdk_path: JDK_TAR_GZ_FILE_NAME_INC_FILE_NAME | ||
solr_xml: SOLR_XML_FILE_NAME | ||
solr_xml_path: SOLR_XML_FILE_PATH_AND_NAME | ||
core_name: SOLR_CORE_NAME | ||
tarz_config_files: PATH_TO_SOLR_CIONFIG_TAR_GZ_FILE | ||
tomcat_dest_folder: TOMCAT7_DEST_FOLER | ||
solr_home_dest_foler: SOLR_BASE_FOLDER | ||
Xmx: HEAP_SPACE_FOR_JVM (e.g. 1024m or 2gb etc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
description: The apache solr module | ||
dependent_templates: | ||
- base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.