Last active
December 28, 2015 20:07
-
-
Save nonZero/8fac4cac71ae687a2027 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @task | |
| def install_elasticsearch(): | |
| run( | |
| 'wget --no-check-certificate -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -') | |
| run( | |
| 'echo "deb http://packages.elastic.co/elasticsearch/1.4/debian stable main" | sudo tee -a /etc/apt/sources.list') | |
| run("sudo apt-get -qq update") | |
| run("sudo apt-get -q upgrade -y") | |
| run("sudo apt-get -q install -y openjdk-7-jre elasticsearch") | |
| run("sudo update-rc.d elasticsearch defaults 95 10") | |
| run("sudo service elasticsearch start") # Is this line needed? | |
| @task | |
| def install_elasticsearch_hebrew(): | |
| # install plugin | |
| with cd("/usr/share/elasticsearch/"): | |
| run("sudo bin/plugin --install analysis-hebrew --url" | |
| " https://bintray.com/artifact/download/synhershko/" | |
| "elasticsearch-analysis-hebrew/elasticsearch-analysis-hebrew-1.7.zip") | |
| # get required hspell-data-files | |
| with cd("/usr/share/elasticsearch/plugins/analysis-hebrew/"): | |
| run( | |
| "sudo GIT_SSL_NO_VERIFY=true git clone https://github.com/nonZero/hspell-data-files.git ") | |
| # update configuration | |
| append( | |
| '/etc/elasticsearch/elasticsearch.yml', | |
| 'hebrew.dict.path: /usr/share/elasticsearch/plugins/analysis-hebrew/hspell-data-files/', | |
| use_sudo=True, | |
| ) | |
| sudo('service elasticsearch restart') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment