scout 5.5.10 → 5.6.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +4 -0
- data/lib/scout/command.rb +9 -2
- data/lib/scout/command/install.rb +1 -1
- data/lib/scout/command/run.rb +1 -1
- data/lib/scout/command/test.rb +1 -1
- data/lib/scout/server.rb +4 -2
- data/lib/scout/version.rb +1 -1
- data/test/scout_test.rb +2 -2
- metadata +5 -5
data/CHANGELOG.markdown
CHANGED
data/lib/scout/command.rb
CHANGED
@@ -30,8 +30,8 @@ module Scout
|
|
30
30
|
opts.separator "--------------------------------------------------------------------------"
|
31
31
|
opts.separator " Normal checkin with server:"
|
32
32
|
opts.separator " #{program_name} [OPTIONS] CLIENT_KEY"
|
33
|
-
opts.separator " ...
|
34
|
-
opts.separator " #{program_name} [OPTIONS]
|
33
|
+
opts.separator " ... or, specifying roles:"
|
34
|
+
opts.separator " #{program_name} --roles app,db [ADDITIONAL OPTIONS] CLIENT_KEY"
|
35
35
|
opts.separator " Install:"
|
36
36
|
opts.separator " #{program_name}"
|
37
37
|
opts.separator " ... OR ..."
|
@@ -52,6 +52,12 @@ module Scout
|
|
52
52
|
opts.separator " "
|
53
53
|
opts.separator "Specific Options:"
|
54
54
|
opts.separator "--------------------------------------------------------------------------"
|
55
|
+
opts.on( "-r", "--roles role1,role2", String,
|
56
|
+
"Roles for this server. Roles are defined through scoutapp.com's web UI" ) do |roles|
|
57
|
+
options[:roles] = roles
|
58
|
+
end
|
59
|
+
|
60
|
+
|
55
61
|
opts.on( "-s", "--server SERVER", String,
|
56
62
|
"The URL for the server to report to." ) do |url|
|
57
63
|
options[:server] = url
|
@@ -155,6 +161,7 @@ module Scout
|
|
155
161
|
end
|
156
162
|
|
157
163
|
def initialize(options, args)
|
164
|
+
@roles = options[:roles]
|
158
165
|
@server = options[:server] || "https://scoutapp.com/"
|
159
166
|
@history = options[:history] ||
|
160
167
|
File.join( File.join( (File.expand_path("~") rescue "/"),
|
@@ -22,7 +22,7 @@ module Scout
|
|
22
22
|
|
23
23
|
puts "\nAttempting to contact the server..."
|
24
24
|
begin
|
25
|
-
Scout::Server.new(server, key, history, log, server_name, @http_proxy, @https_proxy) do |scout|
|
25
|
+
Scout::Server.new(server, key, history, log, server_name, @http_proxy, @https_proxy, @roles) do |scout|
|
26
26
|
scout.fetch_plan
|
27
27
|
scout.run_plugins_by_plan
|
28
28
|
end
|
data/lib/scout/command/run.rb
CHANGED
@@ -10,7 +10,7 @@ module Scout
|
|
10
10
|
log.debug("Running Scout [#{Scout::VERSION}] on #{Socket.gethostname}") if log
|
11
11
|
log.debug("Configuration directory is #{configuration_directory} ") if log
|
12
12
|
# TODO: too much external logic of command doing things TO server. This should be moved into the server class.
|
13
|
-
@scout = Scout::Server.new(server, key, history, log, server_name, @http_proxy, @https_proxy)
|
13
|
+
@scout = Scout::Server.new(server, key, history, log, server_name, @http_proxy, @https_proxy, @roles)
|
14
14
|
@scout.load_history
|
15
15
|
|
16
16
|
unless $stdin.tty?
|
data/lib/scout/command/test.rb
CHANGED
@@ -45,7 +45,7 @@ module Scout
|
|
45
45
|
puts "== You haven't provided any options for running this plugin."
|
46
46
|
end
|
47
47
|
|
48
|
-
Scout::Server.new(nil, nil, history, log, server_name, @http_proxy, @https_proxy) do |scout|
|
48
|
+
Scout::Server.new(nil, nil, history, log, server_name, @http_proxy, @https_proxy, nil) do |scout|
|
49
49
|
scout.prepare_checkin
|
50
50
|
scout.process_plugin( 'interval' => 0,
|
51
51
|
'plugin_id' => 1,
|
data/lib/scout/server.rb
CHANGED
@@ -27,7 +27,7 @@ module Scout
|
|
27
27
|
attr_reader :client_key
|
28
28
|
|
29
29
|
# Creates a new Scout Server connection.
|
30
|
-
def initialize(server, client_key, history_file, logger = nil, server_name=nil, http_proxy='', https_proxy='')
|
30
|
+
def initialize(server, client_key, history_file, logger = nil, server_name=nil, http_proxy='', https_proxy='', roles='')
|
31
31
|
@server = server
|
32
32
|
@client_key = client_key
|
33
33
|
@history_file = history_file
|
@@ -35,7 +35,8 @@ module Scout
|
|
35
35
|
@logger = logger
|
36
36
|
@server_name = server_name
|
37
37
|
@http_proxy = http_proxy
|
38
|
-
@https_proxy
|
38
|
+
@https_proxy = https_proxy
|
39
|
+
@roles = roles
|
39
40
|
@plugin_plan = []
|
40
41
|
@plugins_with_signature_errors = []
|
41
42
|
@directives = {} # take_snapshots, interval, sleep_interval
|
@@ -90,6 +91,7 @@ module Scout
|
|
90
91
|
url = urlify(:plan)
|
91
92
|
info "Fetching plan from server at #{url}..."
|
92
93
|
headers = {"x-scout-tty" => ($stdin.tty? ? 'true' : 'false')}
|
94
|
+
headers["x-scout-roles"] = @roles
|
93
95
|
|
94
96
|
get(url, "Could not retrieve plan from server.", headers) do |res|
|
95
97
|
begin
|
data/lib/scout/version.rb
CHANGED
data/test/scout_test.rb
CHANGED
@@ -30,7 +30,7 @@ PLUGINS_PROPERTIES = File.join AGENT_DIR, 'plugins.properties'
|
|
30
30
|
PATH_TO_TEST_PLUGIN = File.expand_path( File.dirname(__FILE__) ) + '/plugins/temp_plugin.rb'
|
31
31
|
|
32
32
|
class ScoutTest < Test::Unit::TestCase
|
33
|
-
def setup
|
33
|
+
def setup
|
34
34
|
load_fixtures :clients, :accounts, :plugins, :subscriptions, :plugin_metas
|
35
35
|
clear_tables :plugin_activities, :ar_descriptors, :summaries
|
36
36
|
clear_working_dir
|
@@ -591,7 +591,7 @@ mybar=100
|
|
591
591
|
ActiveRecord::Base.store_full_sti_class = true
|
592
592
|
ActiveRecord::Base.establish_connection(db_hash)
|
593
593
|
# scout models and local models
|
594
|
-
|
594
|
+
require SCOUT_PATH + '/lib/enum.rb'
|
595
595
|
require SINATRA_PATH + '/app/models/ar_models.rb'
|
596
596
|
|
597
597
|
ActiveRecord::Base.default_timezone = :utc
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
5
|
-
prerelease:
|
4
|
+
version: 5.6.0.alpha
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andre Lewis
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: elif
|
@@ -238,9 +238,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
238
238
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
239
|
none: false
|
240
240
|
requirements:
|
241
|
-
- - ! '
|
241
|
+
- - ! '>'
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
243
|
+
version: 1.3.1
|
244
244
|
requirements: []
|
245
245
|
rubyforge_project: scout
|
246
246
|
rubygems_version: 1.8.24
|