BibOpsworks 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bib/opsworks/composer.rb +8 -13
- data/lib/bib/opsworks/newrelic.rb +11 -3
- data/lib/bib/opsworks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 265e8d38d3a905d61c6383dddf5c60777cb6f251
|
4
|
+
data.tar.gz: 976027a7d01b175292cab859f3eaeee6a906e282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4fdc2b24a93d645c0dd35bdeeede21b7a4a3e5392ff01408d6f408120570d627e16c418963f2c49e592fb0358dcdfdcedb2c6c0f11f827d9bf366386e91ee7f
|
7
|
+
data.tar.gz: d49e6abdfef4eb2fa28a584ed7d24955f4e07d11656dfae6cf854d8a2d5375c335d8c44b796f53d7d35ce9fb6f2a621b7d4e081dd6daf5d91b8fb7f8779555a6
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'logger'
|
2
3
|
|
3
4
|
module Bib
|
4
5
|
module Opsworks
|
5
6
|
class Composer
|
6
7
|
|
7
8
|
def copy_vendor(release_path, deploy_user)
|
9
|
+
|
10
|
+
log_file = File.new('/tmp/test-copy-vendor.log', 'a')
|
11
|
+
log = Logger.new(log_file, 'weekly')
|
12
|
+
$stderr = log_file
|
13
|
+
$stdout = log_file
|
14
|
+
|
15
|
+
|
8
16
|
app_current = ::File.expand_path("#{release_path}/../../current")
|
9
17
|
vendor_dir = "#{app_current}/vendor"
|
10
18
|
|
@@ -19,19 +27,6 @@ module Bib
|
|
19
27
|
log.debug("Chown Vendor #{release_vendor} to #{deploy_username}.#{deploy_group}")
|
20
28
|
result = ::FileUtils.chown_R deploy_username, deploy_group, release_vendor, :verbose => true if ::File.exists?(release_vendor)
|
21
29
|
end
|
22
|
-
|
23
|
-
def log
|
24
|
-
if(defined?(Chef))
|
25
|
-
Chef::Log
|
26
|
-
else
|
27
|
-
unless(@logger)
|
28
|
-
require 'logger'
|
29
|
-
@logger = Logger.new($stdout)
|
30
|
-
end
|
31
|
-
@logger
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
30
|
end
|
36
31
|
end
|
37
32
|
end
|
@@ -1,10 +1,16 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'logger'
|
2
3
|
|
3
4
|
module Bib
|
4
5
|
module Opsworks
|
5
6
|
class Newrelic
|
6
7
|
|
7
8
|
def publish_deployment(app_name, deploy_data, newrelic_api_key)
|
9
|
+
log_file = File.new('/tmp/test-publish-deployment.log', 'a')
|
10
|
+
log = Logger.new(log_file, 'weekly')
|
11
|
+
$stderr = log_file
|
12
|
+
$stdout = log_file
|
13
|
+
|
8
14
|
newrelic_params = prepare_publishing_data(app_name, deploy_data)
|
9
15
|
|
10
16
|
newrelic_url = "https://rpm.newrelic.com/deployments.xml"
|
@@ -12,11 +18,13 @@ module Bib
|
|
12
18
|
request = Net::HTTP::Post.new(url.request_uri)
|
13
19
|
request.add_field('X-Api-Key', newrelic_api_key)
|
14
20
|
request.set_form_data(newrelic_params)
|
15
|
-
|
21
|
+
|
22
|
+
log.debug("Newrelic Data: " + newrelic_params.inspect)
|
23
|
+
|
16
24
|
http = Net::HTTP.new(url.host, url.port)
|
17
25
|
http.use_ssl = true
|
18
26
|
resp = http.request(request)
|
19
|
-
|
27
|
+
log.debug("Newrelic Response: " + resp.inspect )
|
20
28
|
resp.is_a? Net::HTTPSuccess
|
21
29
|
end
|
22
30
|
|
@@ -38,7 +46,7 @@ module Bib
|
|
38
46
|
newrelic_params["deployment[#{k}]"] = v unless v.nil? || v == ''
|
39
47
|
end
|
40
48
|
newrelic_params
|
41
|
-
end
|
49
|
+
end
|
42
50
|
end
|
43
51
|
end
|
44
52
|
end
|
data/lib/bib/opsworks/version.rb
CHANGED