Commit 1161e7a4a724e44d1c1e545d4fdf59636801285f
1 parent
90f276f2
Exists in
elasticsearch_api
Rakefile to download and install elasticsearch
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
| 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 dpkg -i /tmp/elasticsearch.deb || sudo apt-get install -f' | ||
| 17 | +end |