forked from betarelease/cc_monitor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
55 lines (46 loc) · 1.26 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
#cc rb example http://cruisecontrol/XmlStatusReport.aspx
#cc java example http://cruisecontrol:8080/dashboard/cctray.xml
require 'config'
namespace :db do
desc "Setup environment"
task :environment do
load 'environment.rb'
end
task :create => [:environment] do
end
desc "Migrate the database"
task :migrate => [:environment] do
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Migration.verbose = true
ActiveRecord::Migrator.migrate('migrations', ENV["VERSION"] ? ENV["VERSION"].to_i : nil )
end
end
desc "Run all specs"
task :spec do
Dir.glob("spec/model/*.rb").each do |spec_name|
puts "Running #{spec_name}"
puts `spec #{spec_name}`
end
end
namespace :monitor do
desc "Start monitor"
task :start do
require 'start'
start
end
desc "Start monitor under test mode"
task :test do
require 'start'
start
end
desc "Start test publisher for the monitor"
task :test_publisher do
require 'test/test_publisher'
PUBLISHER_PORT = 3000
server = WEBrick::HTTPServer.new(:Port => PUBLISHER_PORT)
server.mount "/test_publisher", TestPublisher
trap("INT"){ server.shutdown }
puts "Starting Test Publisher on port: #{PUBLISHER_PORT}"
server.start
end
end