Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a task to unpack the rabbitmq server
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'fileutils' | ||
|
||
here = File.dirname(__FILE__) | ||
vendor = File.expand_path(here + '/../vendor/') | ||
run = File.expand_path(here + '/../run/') | ||
|
||
desc 'install dependencies' | ||
task :install_dependencies => [ :install_rabbit_mq ] do | ||
puts "Done." | ||
end | ||
|
||
desc 'install the RabbitMQ message server' | ||
task :install_rabbit_mq do | ||
target = File.expand_path(run+'/rabbitmq') | ||
if File.directory?(target) | ||
puts "RabbitMQ already installed in [#{target}]" | ||
else | ||
puts "installing RabbitMQ in [#{target}]..." | ||
|
||
tarball = vendor + '/rabbitmq-server*.tar.gz' | ||
`cd #{run}; tar xfvz #{tarball}` | ||
`cd #{run}; mv rabbitmq* rabbitmq` | ||
end | ||
end |