skylight 0.10.6 → 1.0.0.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -29
- data/LICENSE.md +1 -1
- data/ext/extconf.rb +13 -18
- data/ext/libskylight.yml +4 -4
- data/lib/skylight/api.rb +1 -5
- data/lib/skylight/cli.rb +1 -6
- data/lib/skylight/config.rb +30 -14
- data/lib/skylight/core.rb +1 -3
- data/lib/skylight/middleware.rb +0 -7
- data/lib/skylight/normalizers/active_model_serializers/render.rb +1 -3
- data/lib/skylight/normalizers/grape/endpoint.rb +1 -1
- data/lib/skylight/probes/sequel.rb +5 -8
- data/lib/skylight/probes/sinatra.rb +1 -3
- data/lib/skylight/railtie.rb +11 -12
- data/lib/skylight/user_config.rb +1 -1
- data/lib/skylight/util/deploy.rb +65 -15
- data/lib/skylight/util/logging.rb +0 -1
- data/lib/skylight/util/native_ext_fetcher.rb +3 -4
- data/lib/skylight/version.rb +1 -1
- metadata +6 -6
- data/lib/skylight/util/proxy.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65cea5cc60bb1c3e0a8025ca0486b586434cd54b
|
4
|
+
data.tar.gz: 7c98c5e24d2922cd684462ae86d5c125e1432a80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6767a9393d6fe515fea63ee0b4c0b92b424606325b3842fbd5949dd1e22b4cee787e8bcacd7ea67e8009872912c6202d63a6a700b8ad74d39b1b3a81d4307eae
|
7
|
+
data.tar.gz: 1a1240244582028e5e1bbb40e7a551e053f8158586c4fce0032b4b0a44a42b58fdbf98981d0bf2b744a2a20f97d7788b3af6d3f1e98ed0793f0f757a603ba191
|
data/CHANGELOG.md
CHANGED
@@ -1,34 +1,11 @@
|
|
1
|
-
## 0.
|
1
|
+
## 1.0.0.beta2 (January 14, 2016)
|
2
2
|
|
3
|
-
* [BUGFIX]
|
3
|
+
* [BUGFIX] Fix version format so Rust agent can load config.
|
4
4
|
|
5
|
-
## 0.
|
5
|
+
## 1.0.0.beta1 (January 14, 2016) [YANKED]
|
6
6
|
|
7
|
-
* [
|
8
|
-
* [BUGFIX]
|
9
|
-
* [BUGFIX] Fix setting `proxy_url` in config YML
|
10
|
-
* [IMPROVEMENT] Log errors during authentication validation
|
11
|
-
|
12
|
-
## 0.10.4 (June 3, 2016)
|
13
|
-
|
14
|
-
* [BUGFIX] Sinatra instrumenation now works for latest master
|
15
|
-
* [BUGFIX] Sequel support for 4.35.0
|
16
|
-
* [BUGFIX] Handle latest ActiveModel::Serializers version
|
17
|
-
* [BUGFIX] More precise check for existence of Rails
|
18
|
-
* [BREAKING] Drop official support for Sinatra 1.2 (it likely never worked correctly)
|
19
|
-
* [IMPROVEMENT] On Heroku, logs are now written to STDOUT
|
20
|
-
* [IMPROVEMENT] Allow Skylight to raise on logged errors, useful for testing and debugging
|
21
|
-
* [IMPROVEMENT] Finish Rack::Responses in Middleware
|
22
|
-
* [IMRPOVEMENT] Better message when config/skylight.yml already exists
|
23
|
-
* [IMPROVEMENT] Update Rust Agent with SQL improvements, including handling for arrays and WITH
|
24
|
-
|
25
|
-
## 0.10.3 (February 2, 2016)
|
26
|
-
|
27
|
-
* [BUGFIX] Don't validate configuration on disabled environments.
|
28
|
-
|
29
|
-
## 0.10.2 (January 19, 2016)
|
30
|
-
|
31
|
-
* [BUGFIX] Fix git repository warning on startup. [Issue #58](https://github.com/skylightio/skylight-ruby/issues/58)
|
7
|
+
* [FEATURE] Deploy tracking support. Contact support@skylight.io to have this enabled for your account.
|
8
|
+
* [BUGFIX] Correct documentation link in `skylight setup`.
|
32
9
|
|
33
10
|
## 0.10.1 (January 4, 2016)
|
34
11
|
|
@@ -46,7 +23,7 @@
|
|
46
23
|
|
47
24
|
## 0.9.4 (November 23, 2015)
|
48
25
|
|
49
|
-
* [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
|
26
|
+
* [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
|
50
27
|
* [BUGFIX] SQL lexer now handles indentifiers beginning with underscores.
|
51
28
|
* [BUGFIX] Excon instrumentation now works correctly.
|
52
29
|
* [BUGFIX] Graceful handling of native agent failures on old OS X versions.
|
data/LICENSE.md
CHANGED
data/ext/extconf.rb
CHANGED
@@ -24,8 +24,6 @@ SKYLIGHT_SOURCE_URL = ENV['SKYLIGHT_SOURCE_URL']
|
|
24
24
|
SKYLIGHT_VERSION = ENV['SKYLIGHT_VERSION']
|
25
25
|
SKYLIGHT_CHECKSUM = ENV['SKYLIGHT_CHECKSUM']
|
26
26
|
|
27
|
-
SKYLIGHT_EXT_STRICT = ENV.key?("SKYLIGHT_EXT_STRICT") && ENV['SKYLIGHT_EXT_STRICT'] =~ /^true$/i
|
28
|
-
|
29
27
|
# Setup logger
|
30
28
|
LOG = Logger.new(MultiIO.new(STDOUT, File.open(SKYLIGHT_INSTALL_LOG, 'a')))
|
31
29
|
|
@@ -187,16 +185,9 @@ unless have_func('rb_thread_call_without_gvl', 'ruby/thread.h')
|
|
187
185
|
have_func('rb_thread_blocking_region') or abort "Ruby is unexpectedly missing rb_thread_blocking_region. This should not happen."
|
188
186
|
end
|
189
187
|
|
190
|
-
#
|
191
|
-
#
|
192
|
-
|
193
|
-
# Despite this comment, everything appears to build fine without the flag on. Since this
|
194
|
-
# flag can cause issues for some customers we're turning it off by default. However,
|
195
|
-
# in development and CI, we still have the option of turning it back on to help catch
|
196
|
-
# potential issues.
|
197
|
-
if SKYLIGHT_EXT_STRICT
|
198
|
-
$CFLAGS << " -Werror"
|
199
|
-
end
|
188
|
+
# Some extra checks
|
189
|
+
# -Werror is needed for the fast thread local storage
|
190
|
+
$CFLAGS << " -Werror"
|
200
191
|
|
201
192
|
checking_for 'fast thread local storage' do
|
202
193
|
if try_compile("__thread int foo;")
|
@@ -205,13 +196,17 @@ checking_for 'fast thread local storage' do
|
|
205
196
|
end
|
206
197
|
end
|
207
198
|
|
208
|
-
#
|
209
|
-
|
199
|
+
# spec = nil
|
200
|
+
# checking_for('thread_specific', '%s') do
|
201
|
+
# spec = %w[__declspec(thread) __thread].find {|th|
|
202
|
+
# try_compile("#{th} int foo;", "", :werror => true)
|
203
|
+
# }
|
204
|
+
# spec or 'no'
|
205
|
+
# end
|
206
|
+
# $defs << "-DRB_THREAD_SPECIFIC=#{spec}" if spec
|
210
207
|
|
211
|
-
#
|
212
|
-
|
213
|
-
$CFLAGS << " -pedantic"
|
214
|
-
end
|
208
|
+
# Flag -std=c99 required for older build systems
|
209
|
+
$CFLAGS << " -std=c99 -pedantic -Wall -fno-strict-aliasing"
|
215
210
|
|
216
211
|
# TODO: Compute the relative path to the location
|
217
212
|
create_makefile 'skylight_native', File.expand_path('..', __FILE__) # or fail "could not create makefile"
|
data/ext/libskylight.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
|
-
version: "
|
2
|
+
version: "0.7.0-b2a5f4b"
|
3
3
|
checksums:
|
4
|
-
x86-linux: "
|
5
|
-
x86_64-linux: "
|
6
|
-
x86_64-darwin: "
|
4
|
+
x86-linux: "4ea1f0382dbbba12454d5121a4b400278b2b515b79b676e7d4a2655cdc088bfe"
|
5
|
+
x86_64-linux: "42a958e6fe7f5d9b459e10ffc62c336c44f00e46c253b7f466a72f2902e8e130"
|
6
|
+
x86_64-darwin: "7958533c605d98f43fbe54cdd7f7a6e39d6c8fee30acd29494465213afd123ef"
|
data/lib/skylight/api.rb
CHANGED
@@ -3,8 +3,6 @@ require 'uri'
|
|
3
3
|
module Skylight
|
4
4
|
# @api private
|
5
5
|
class Api
|
6
|
-
include Util::Logging
|
7
|
-
|
8
6
|
attr_reader :config, :http
|
9
7
|
|
10
8
|
class CreateFailed < StandardError
|
@@ -55,11 +53,9 @@ module Skylight
|
|
55
53
|
when 400...500
|
56
54
|
:invalid
|
57
55
|
else
|
58
|
-
warn res.exception.message if res.exception
|
59
56
|
:unknown
|
60
57
|
end
|
61
|
-
rescue
|
62
|
-
warn e.message
|
58
|
+
rescue
|
63
59
|
:unknown
|
64
60
|
end
|
65
61
|
|
data/lib/skylight/cli.rb
CHANGED
@@ -13,12 +13,7 @@ module Skylight
|
|
13
13
|
desc "setup TOKEN", "Sets up a new app using the provided token"
|
14
14
|
def setup(token=nil)
|
15
15
|
if File.exist?(config_path)
|
16
|
-
say
|
17
|
-
A config/skylight.yml already exists for your application.
|
18
|
-
|
19
|
-
Visit your app at https://www.skylight.io/app or remove config/skylight.yml
|
20
|
-
to set it up as a new app in Skylight.
|
21
|
-
OUT
|
16
|
+
say "Your app is already on Skylight. http://www.skylight.io", :green
|
22
17
|
return
|
23
18
|
end
|
24
19
|
|
data/lib/skylight/config.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'uri'
|
2
1
|
require 'yaml'
|
3
2
|
require 'fileutils'
|
4
3
|
require 'thread'
|
@@ -9,7 +8,6 @@ require 'skylight/util/hostname'
|
|
9
8
|
require 'skylight/util/logging'
|
10
9
|
require 'skylight/util/platform'
|
11
10
|
require 'skylight/util/ssl'
|
12
|
-
require 'skylight/util/proxy'
|
13
11
|
|
14
12
|
module Skylight
|
15
13
|
class Config
|
@@ -25,7 +23,11 @@ module Skylight
|
|
25
23
|
'ROOT' => :'root',
|
26
24
|
'HOSTNAME' => :'hostname',
|
27
25
|
'SESSION_TOKEN' => :'session_token',
|
28
|
-
|
26
|
+
|
27
|
+
# == Deploy settings ==
|
28
|
+
'DEPLOY_ID' => :'deploy.id',
|
29
|
+
'DEPLOY_GIT_SHA' => :'deploy.git_sha',
|
30
|
+
'DEPLOY_DESCRIPTION' => :'deploy.description',
|
29
31
|
|
30
32
|
# == Logging ==
|
31
33
|
'LOG_FILE' => :'log_file',
|
@@ -118,7 +120,6 @@ module Skylight
|
|
118
120
|
|
119
121
|
NATIVE_ENV = [
|
120
122
|
:'version',
|
121
|
-
:'authentication',
|
122
123
|
:'root',
|
123
124
|
:'hostname',
|
124
125
|
:'deploy_id',
|
@@ -242,10 +243,7 @@ module Skylight
|
|
242
243
|
|
243
244
|
return ret unless env
|
244
245
|
|
245
|
-
|
246
|
-
if proxy_url = Util::Proxy.detect_url(env)
|
247
|
-
ret[:proxy_url] = proxy_url
|
248
|
-
end
|
246
|
+
ret[:proxy_url] = detect_proxy_url(env)
|
249
247
|
|
250
248
|
env.each do |k, val|
|
251
249
|
# Support deprecated SK_ key prefix
|
@@ -267,6 +265,13 @@ module Skylight
|
|
267
265
|
ret
|
268
266
|
end
|
269
267
|
|
268
|
+
def self.detect_proxy_url(env)
|
269
|
+
if u = env['HTTP_PROXY'] || env['http_proxy']
|
270
|
+
u = "http://#{u}" unless u =~ %r[://]
|
271
|
+
u
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
270
275
|
# @api private
|
271
276
|
def skip_validation?
|
272
277
|
!!get(:skip_validation)
|
@@ -397,6 +402,8 @@ module Skylight
|
|
397
402
|
def to_native_env
|
398
403
|
ret = []
|
399
404
|
|
405
|
+
ret << "SKYLIGHT_AUTHENTICATION" << authentication_with_deploy
|
406
|
+
|
400
407
|
NATIVE_ENV.each do |key|
|
401
408
|
if value = send_or_get(key)
|
402
409
|
env_key = ENV_TO_KEY.key(key) || key.upcase
|
@@ -463,6 +470,19 @@ authentication: #{self[:authentication]}
|
|
463
470
|
self[:root] || Dir.pwd
|
464
471
|
end
|
465
472
|
|
473
|
+
def authentication_with_deploy
|
474
|
+
token = get(:authentication)
|
475
|
+
|
476
|
+
if token && deploy
|
477
|
+
deploy_str = deploy.to_query_string
|
478
|
+
# A pipe should be a safe delimiter since it's not in the standard token
|
479
|
+
# and is encoded by URI
|
480
|
+
token += "|#{deploy.to_query_string}"
|
481
|
+
end
|
482
|
+
|
483
|
+
token
|
484
|
+
end
|
485
|
+
|
466
486
|
def logger
|
467
487
|
@logger ||=
|
468
488
|
MUTEX.synchronize do
|
@@ -501,12 +521,8 @@ authentication: #{self[:authentication]}
|
|
501
521
|
@alert_logger = logger
|
502
522
|
end
|
503
523
|
|
504
|
-
def
|
505
|
-
|
506
|
-
end
|
507
|
-
|
508
|
-
def deploy_id
|
509
|
-
@deploy_id = Util::Deploy.detect_id(self)
|
524
|
+
def deploy
|
525
|
+
@deploy ||= Util::Deploy.build(self)
|
510
526
|
end
|
511
527
|
|
512
528
|
private
|
data/lib/skylight/core.rb
CHANGED
@@ -7,9 +7,7 @@ module Skylight
|
|
7
7
|
# Load the native agent
|
8
8
|
require 'skylight/native'
|
9
9
|
|
10
|
-
|
11
|
-
# customer having Rails defined without having all of Rails loaded.
|
12
|
-
if defined?(Rails::Railtie)
|
10
|
+
if defined?(Rails)
|
13
11
|
require 'skylight/railtie'
|
14
12
|
end
|
15
13
|
|
data/lib/skylight/middleware.rb
CHANGED
@@ -59,13 +59,6 @@ module Skylight
|
|
59
59
|
t { "middleware beginning trace" }
|
60
60
|
trace = Skylight.trace "Rack", 'app.rack.request'
|
61
61
|
resp = @app.call(env)
|
62
|
-
|
63
|
-
# Responses should be finished but in some situations they aren't
|
64
|
-
# e.g. https://github.com/ruby-grape/grape/issues/1041
|
65
|
-
if resp.respond_to?(:finish)
|
66
|
-
resp = resp.finish
|
67
|
-
end
|
68
|
-
|
69
62
|
resp[2] = BodyProxy.new(resp[2]) { trace.submit } if trace
|
70
63
|
resp
|
71
64
|
rescue Exception
|
@@ -12,9 +12,7 @@ module Skylight
|
|
12
12
|
title = serializer_class.name.sub(/^ActiveModel::(Serializer::)?/, '')
|
13
13
|
|
14
14
|
if adapter_instance = payload[:adapter]
|
15
|
-
adapter_name = adapter_instance.class.name
|
16
|
-
.sub(/^ActiveModel::Serializer::Adapter::/, '')
|
17
|
-
.sub(/^ActiveModelSerializers::Adapter::/, '')
|
15
|
+
adapter_name = adapter_instance.class.name.sub(/^ActiveModel::Serializer::Adapter::/, '')
|
18
16
|
desc = "Adapter: #{adapter_name}"
|
19
17
|
end
|
20
18
|
|
@@ -5,14 +5,11 @@ module Skylight
|
|
5
5
|
class Probe
|
6
6
|
def install
|
7
7
|
require 'sequel/database/logging'
|
8
|
+
::Sequel::Database.class_eval do
|
9
|
+
alias log_yield_without_sk log_yield
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
::Sequel::Database.class_eval <<-end_eval
|
12
|
-
alias #{method_name}_without_sk #{method_name}
|
13
|
-
|
14
|
-
def #{method_name}(sql, *args, &block)
|
15
|
-
#{method_name}_without_sk(sql, *args) do
|
11
|
+
def log_yield(sql, args=nil, &block)
|
12
|
+
log_yield_without_sk(sql, *args) do
|
16
13
|
::ActiveSupport::Notifications.instrument(
|
17
14
|
"sql.sequel",
|
18
15
|
sql: sql,
|
@@ -23,7 +20,7 @@ module Skylight
|
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
26
|
-
|
23
|
+
end
|
27
24
|
end
|
28
25
|
end
|
29
26
|
end
|
@@ -8,9 +8,7 @@ module Skylight
|
|
8
8
|
alias compile_without_sk! compile!
|
9
9
|
|
10
10
|
def compile!(verb, path, *args, &block)
|
11
|
-
compile_without_sk!(verb, path, *args, &block).tap do |_, _,
|
12
|
-
wrapper ||= keys_or_wrapper
|
13
|
-
|
11
|
+
compile_without_sk!(verb, path, *args, &block).tap do |_, _, _, wrapper|
|
14
12
|
# Deal with the situation where the path is a regex, and the default behavior
|
15
13
|
# of Ruby stringification produces an unreadable mess
|
16
14
|
if path.is_a?(Regexp)
|
data/lib/skylight/railtie.rb
CHANGED
@@ -25,17 +25,11 @@ module Skylight
|
|
25
25
|
|
26
26
|
if activate?
|
27
27
|
if config
|
28
|
-
|
29
|
-
config
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Rails.logger.info "[SKYLIGHT] [#{Skylight::VERSION}] Skylight agent enabled"
|
34
|
-
else
|
35
|
-
Rails.logger.info "[SKYLIGHT] [#{Skylight::VERSION}] Unable to start"
|
36
|
-
end
|
37
|
-
rescue ConfigError => e
|
38
|
-
Rails.logger.error "[SKYLIGHT] [#{Skylight::VERSION}] #{e.message}; disabling Skylight agent"
|
28
|
+
if Instrumenter.start!(config)
|
29
|
+
app.middleware.insert 0, Middleware, config: config
|
30
|
+
Rails.logger.info "[SKYLIGHT] [#{Skylight::VERSION}] Skylight agent enabled"
|
31
|
+
else
|
32
|
+
Rails.logger.info "[SKYLIGHT] [#{Skylight::VERSION}] Unable to start"
|
39
33
|
end
|
40
34
|
end
|
41
35
|
elsif Rails.env.development?
|
@@ -78,7 +72,12 @@ module Skylight
|
|
78
72
|
|
79
73
|
config[:'daemon.sockdir_path'] ||= tmp
|
80
74
|
config[:'normalizers.render.view_paths'] = existent_paths(app.config.paths["app/views"]) + [Rails.root.to_s]
|
75
|
+
config.validate!
|
81
76
|
config
|
77
|
+
|
78
|
+
rescue ConfigError => e
|
79
|
+
Rails.logger.error "[SKYLIGHT] [#{Skylight::VERSION}] #{e.message}; disabling Skylight agent"
|
80
|
+
nil
|
82
81
|
end
|
83
82
|
|
84
83
|
def configure_logging(config, app)
|
@@ -88,7 +87,7 @@ module Skylight
|
|
88
87
|
# Configure the log file destination
|
89
88
|
if log_file = app.config.skylight.log_file
|
90
89
|
config['log_file'] = log_file
|
91
|
-
elsif !config.key?('log_file')
|
90
|
+
elsif !config.key?('log_file')
|
92
91
|
config['log_file'] = File.join(Rails.root, 'log/skylight.log')
|
93
92
|
end
|
94
93
|
|
data/lib/skylight/user_config.rb
CHANGED
data/lib/skylight/util/deploy.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
module Skylight
|
4
5
|
module Util
|
5
6
|
|
6
7
|
module Deploy
|
7
8
|
|
8
|
-
def self.
|
9
|
+
def self.build(config)
|
9
10
|
DEPLOY_TYPES.each do |type|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
11
|
+
deploy = type.new(config)
|
12
|
+
return deploy if deploy.id
|
13
13
|
end
|
14
14
|
nil
|
15
15
|
end
|
@@ -17,52 +17,102 @@ module Skylight
|
|
17
17
|
class EmptyDeploy
|
18
18
|
|
19
19
|
attr_reader :config
|
20
|
+
attr_reader :timestamp
|
20
21
|
|
21
22
|
def initialize(config)
|
22
23
|
@config = config
|
24
|
+
@timestamp = Time.now.to_i
|
23
25
|
end
|
24
26
|
|
25
27
|
def id
|
28
|
+
git_sha
|
29
|
+
end
|
30
|
+
|
31
|
+
def git_sha
|
26
32
|
nil
|
27
33
|
end
|
28
34
|
|
35
|
+
def description
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_query_string
|
40
|
+
URI.encode_www_form(
|
41
|
+
timestamp: timestamp,
|
42
|
+
deploy_id: id.to_s[0..100], # Keep this sane
|
43
|
+
git_sha: git_sha[0..40], # A valid SHA will never exceed 40
|
44
|
+
description: description[0..255]) # Avoid massive descriptions
|
45
|
+
end
|
46
|
+
|
29
47
|
end
|
30
48
|
|
31
49
|
class DefaultDeploy < EmptyDeploy
|
32
50
|
|
33
51
|
def id
|
34
|
-
config.get(:
|
52
|
+
config.get(:'deploy.id') || git_sha
|
53
|
+
end
|
54
|
+
|
55
|
+
def git_sha
|
56
|
+
config.get(:'deploy.git_sha')
|
57
|
+
end
|
58
|
+
|
59
|
+
def description
|
60
|
+
config.get(:'deploy.description')
|
35
61
|
end
|
36
62
|
|
37
63
|
end
|
38
64
|
|
39
65
|
class HerokuDeploy < EmptyDeploy
|
40
66
|
|
67
|
+
def initialize(*)
|
68
|
+
super
|
69
|
+
@info = get_info
|
70
|
+
end
|
71
|
+
|
41
72
|
def id
|
42
|
-
|
43
|
-
|
44
|
-
|
73
|
+
@info ? @info['id'] : nil
|
74
|
+
end
|
75
|
+
|
76
|
+
def git_sha
|
77
|
+
@info ? @info['commit'] : nil
|
78
|
+
end
|
79
|
+
|
80
|
+
def description
|
81
|
+
@info ? @info['description'] : nil
|
45
82
|
end
|
46
83
|
|
47
84
|
private
|
48
85
|
|
49
86
|
def get_info
|
50
87
|
info_path = config[:'heroku.dyno_info_path']
|
51
|
-
|
52
|
-
|
88
|
+
|
89
|
+
if File.exist?(info_path)
|
90
|
+
if info = JSON.parse(File.read(info_path))
|
91
|
+
info['release']
|
92
|
+
end
|
93
|
+
end
|
53
94
|
end
|
54
95
|
|
55
96
|
end
|
56
97
|
|
57
98
|
class GitDeploy < EmptyDeploy
|
58
99
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
100
|
+
attr_reader :git_sha, :description
|
101
|
+
|
102
|
+
def initialize(*)
|
103
|
+
super
|
104
|
+
@git_sha, @description = get_info
|
64
105
|
end
|
65
106
|
|
107
|
+
private
|
108
|
+
|
109
|
+
def get_info
|
110
|
+
Dir.chdir(config.root) do
|
111
|
+
info = `git log -1 --pretty="%H %s" 2>&1`
|
112
|
+
info.split(" ", 2).map(&:strip) if $?.success?
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
66
116
|
end
|
67
117
|
|
68
118
|
DEPLOY_TYPES = [DefaultDeploy, HerokuDeploy, GitDeploy]
|
@@ -4,7 +4,6 @@ require 'net/http'
|
|
4
4
|
require 'fileutils'
|
5
5
|
require 'digest/sha2'
|
6
6
|
require 'skylight/util/ssl'
|
7
|
-
require 'skylight/util/proxy'
|
8
7
|
|
9
8
|
# Used from extconf.rb
|
10
9
|
module Skylight
|
@@ -93,9 +92,9 @@ module Skylight
|
|
93
92
|
when :success
|
94
93
|
log "successfully downloaded native ext; out=#{out}"
|
95
94
|
return extra
|
96
|
-
|
95
|
+
else
|
97
96
|
log "fetching native ext; uri=#{uri}; redirected=#{res}"
|
98
|
-
uri =
|
97
|
+
uri = res
|
99
98
|
|
100
99
|
next
|
101
100
|
end
|
@@ -119,7 +118,7 @@ module Skylight
|
|
119
118
|
end
|
120
119
|
|
121
120
|
def http_get(host, port, use_ssl, path, out)
|
122
|
-
if http_proxy =
|
121
|
+
if http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy']
|
123
122
|
log "connecting with proxy: #{http_proxy}"
|
124
123
|
uri = URI.parse(http_proxy)
|
125
124
|
p_host, p_port = uri.host, uri.port
|
data/lib/skylight/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -113,7 +113,6 @@ files:
|
|
113
113
|
- lib/skylight/util/multi_io.rb
|
114
114
|
- lib/skylight/util/native_ext_fetcher.rb
|
115
115
|
- lib/skylight/util/platform.rb
|
116
|
-
- lib/skylight/util/proxy.rb
|
117
116
|
- lib/skylight/util/ssl.rb
|
118
117
|
- lib/skylight/vendor/active_support/notifications.rb
|
119
118
|
- lib/skylight/vendor/active_support/notifications/fanout.rb
|
@@ -181,13 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
180
|
version: 1.9.2
|
182
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
182
|
requirements:
|
184
|
-
- - "
|
183
|
+
- - ">"
|
185
184
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
185
|
+
version: 1.3.1
|
187
186
|
requirements: []
|
188
187
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.5.1
|
188
|
+
rubygems_version: 2.4.5.1
|
190
189
|
signing_key:
|
191
190
|
specification_version: 4
|
192
191
|
summary: Skylight is a smart profiler for Rails apps
|
193
192
|
test_files: []
|
193
|
+
has_rdoc:
|