public
Description: The 3.0 rewrite of our agent software.
Homepage: http://scoutapp.com/
Clone URL: git://github.com/highgroove/scout_agent.git
scout_agent / Rakefile
100644 126 lines (99 sloc) 4.021 kb
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env rake
 
require "pathname"
 
require "rake/testtask"
require "rake/rdoctask"
require "rake/gempackagetask"
 
require "rubygems"
require "rubyforge"
 
SA_DIR = Pathname.new(File.dirname(__FILE__))
SA_VERSION = (
  SA_DIR + "lib" + "scout_agent.rb"
).read[/^\s*VERSION\s*=\s*(['"])(\d\.\d\.\d)\1/, 2]
SA_SPEC = Gem::Specification.new do |spec|
spec.name = "scout_agent"
spec.version = SA_VERSION
 
spec.platform = Gem::Platform::RUBY
spec.summary = "Scout makes monitoring and reporting on your servers " +
"as flexible and simple as possible."
 
  spec.test_files = %w[test/ts_all.rb]
spec.files = Dir.glob("{bin,lib,test}/**/*.rb") +
%w[ Rakefile setup.rb data/cacert.pem
data/gpl-2.0.txt data/lgpl-2.1.txt ]
  spec.executables = %w[scout_agent]
 
spec.has_rdoc = true
spec.extra_rdoc_files = %w[ AUTHORS COPYING README INSTALL
TODO CHANGELOG LICENSE ]
spec.rdoc_options << "--title" << "Scout Agent Documentation" <<
"--main" << "README"
 
spec.require_path = "lib"
 
  spec.add_dependency("arrayfields", "=4.7.3") # fix Amalgalite's results
  spec.add_dependency("amalgalite", "=0.10.0")
  spec.add_dependency("rest-client", "=1.0")
  spec.add_dependency("json", "=1.1.7")
  spec.add_dependency("xmpp4r", "=0.4")
  spec.add_dependency("elif", "=0.1.0") # used by some plugins
 
spec.authors = [ "James Edward Gray II",
"Derek Haynes",
"Andre Lewis",
"Matt Todd" ]
spec.email = "support@highgroove.com"
spec.rubyforge_project = "scout"
spec.homepage = "http://scoutapp.com"
spec.description = <<END_DESC
Scout is a full server monitoring solution. You can install standard plugins
to get started with basic monitoring right away, or build your own plugins to
address your specific needs. Scout can be tied into any monitoring strategy,
providing you data collection, trend analysis, email notifications and more.
END_DESC
 
  spec.post_install_message = <<END_INSTALL
Installing Scout's agent...
 
If this is your first time installing the agent, you need to give it your
identity to use when connecting to the server. You can do that with the
following command:
  
    sudo scout_agent identify
 
If you are just upgrading, you can start the newly installed agent with:
 
    sudo scout_agent start
 
END_INSTALL
end
 
task :default => [:test]
 
Rake::TestTask.new do |test|
  test.libs << "test"
  test.test_files = %w[test/ts_all.rb]
  test.verbose = true
end
 
Rake::RDocTask.new do |rdoc|
rdoc.main = "README"
rdoc.rdoc_dir = "doc"
rdoc.title = "Scout Agent Documentation"
rdoc.rdoc_files.include( *%w[ README INSTALL TODO CHANGELOG
AUTHORS COPYING LICENSE lib/ ] )
end
 
Rake::GemPackageTask.new(SA_SPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
 
desc "Publishes the agent gem to RubyForge"
task :publish_rubyforge => :package do
  puts "Publishing on RubyForge"
  forge = RubyForge.new
  forge.configure
  puts "Logging in"
  forge.login
 
  release = forge.userconfig
  release["release_changes"] = (SA_DIR + "CHANGELOG").read
  release["preformatted"] = true
 
  package = "pkg/#{SA_SPEC.name}-#{SA_VERSION}"
  files = %W[#{package}.tgz #{package}.zip #{package}.gem].compact
 
  puts "Releasing #{SA_SPEC.name}-#{SA_VERSION}"
  forge.add_release(SA_SPEC.rubyforge_project, SA_SPEC.name, SA_VERSION, *files)
end
 
desc "Upload current documentation RubyForge"
task :upload_docs => :rdoc do
  config = YAML.load(
    File.read(File.expand_path("~/.rubyforge/user-config.yml"))
  )
  host = "#{config['username']}@rubyforge.org"
  remote_dir = "/var/www/gforge-projects/#{SA_SPEC.rubyforge_project}"
  local_dir = "doc"
 
  sh "rsync -av --delete #{local_dir}/ #{host}:#{remote_dir}"
end