-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathRakefile
61 lines (51 loc) · 1.29 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'rubygems'
require 'rake'
$CONFIG = YAML.load_file('config.yml')
$SETTING = YAML.load_file('settings.yaml')
task :default => :test
desc "Run all tests."
task :test do
#TODO: connect to test runner
end
desc "Index music directory."
task :index do
music_dir = $SETTING[:database][:music_dir]
puts "== Index music files in #{music_dir}."
sh "ruby indexer.rb"
end
desc "Start the webinterface."
task :wi_start do
puts "== Try to start the webinterface."
begin
sh "thin -C config.yml -R rackup_hm.ru start"
puts "== HackerMusic webinterface starting on http://localhost:4567"
rescue
puts "== There was an error, maybe the server is already running?"
end
end
desc "Stop the webinterface."
task :wi_stop do
puts "== Try to kill the thin server process."
# TODO: read thin pid from thin.pid file
sh "pkill thin"
end
desc "Start icecast server."
task :icecast_start do
puts "== Start icecast server."
sh "icecast2 -b -c icecast.xml"
end
desc "Stop the icecast server."
task :icecast_stop do
puts "== Stop the icecast server."
sh "pkill icecast"
end
desc "Start streamer."
task :streamer_start do
puts "== Start streamer."
sh "ruby streamer.rb >/tmp/streamer.log &"
end
desc "Stop streamer."
task :streamer_stop do
puts "== Stop streamer."
sh "pkill streamer.rb"
end