BibOpsworks 0.0.9.1 → 0.0.9.2
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.rb +4 -2
- data/lib/bib/opsworks/composer.rb +30 -12
- data/lib/bib/opsworks/newrelic.rb +2 -5
- 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: 03f789efcc970f9d677060d426366dbbbdfcef3d
|
4
|
+
data.tar.gz: 02e26ec6980af2b0af24b6759b585118a38366d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb182e5e551115833de3f2b10b12c13b8c320c271c7b9dedd073cb298d77df71e70a6bcf11596347b8a8eeeb2784ccb7571b490aa2b4668fae6d9c9ccf96ed14
|
7
|
+
data.tar.gz: 95f78ee76e5e733c2bd56720b33faa7acd8ea573c39f8bb5ce47eb1b2838461627e80466062f80b1fdc2f2387f57d9d248aee61e8dbf525aff26c19f57777888
|
data/Gemfile.lock
CHANGED
data/lib/bib/opsworks.rb
CHANGED
@@ -4,14 +4,16 @@ require 'bib/opsworks/version'
|
|
4
4
|
|
5
5
|
class BibOpsworks
|
6
6
|
|
7
|
+
def initialize
|
8
|
+
puts "Bib-Opsworks says: hello world"
|
9
|
+
end
|
10
|
+
|
7
11
|
def copy_composer(release_path, deploy_user)
|
8
|
-
run "echo My very last attempt to get sth in the logs"
|
9
12
|
composer = Bib::Opsworks::Composer.new
|
10
13
|
composer.copy_vendor(release_path, deploy_user)
|
11
14
|
end
|
12
15
|
|
13
16
|
def newrelic_publish_deployment(app_name, deploy_data, newrelic_api_key)
|
14
|
-
run "echo publish deployment"
|
15
17
|
newrelic = Bib::Opsworks::Newrelic.new
|
16
18
|
newrelic.publish_deployment(app_name, deploy_data, newrelic_api_key)
|
17
19
|
end
|
@@ -1,18 +1,14 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
require '
|
2
|
+
require 'stringio'
|
3
|
+
require 'bib/opsworks/logging'
|
3
4
|
|
4
5
|
module Bib
|
5
6
|
module Opsworks
|
6
7
|
class Composer
|
8
|
+
|
9
|
+
include Logging
|
7
10
|
|
8
11
|
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
|
-
|
16
12
|
app_current = ::File.expand_path("#{release_path}/../../current")
|
17
13
|
vendor_dir = "#{app_current}/vendor"
|
18
14
|
|
@@ -21,12 +17,34 @@ module Bib
|
|
21
17
|
|
22
18
|
release_vendor = "#{release_path}/vendor"
|
23
19
|
|
24
|
-
log.debug("Copy Vendor: Copying from #{vendor_dir} to #{release_vendor}")
|
25
|
-
result = ::FileUtils.cp_r vendor_dir, release_vendor, :verbose => true if ::File.exists?(vendor_dir)
|
26
20
|
|
27
|
-
|
28
|
-
|
21
|
+
if ::File.exists?(vendor_dir)
|
22
|
+
fileutils_output = StringIO.new
|
23
|
+
::FileUtils.fileutils_output = fileutils_output
|
24
|
+
log.debug("Copy Vendor: Copying from #{vendor_dir} to #{release_vendor}")
|
25
|
+
::FileUtils.cp_r vendor_dir, release_vendor, :verbose => true
|
26
|
+
log.debug(fileutils_output.string)
|
27
|
+
else
|
28
|
+
log.info('Vendor dir #{vendor_dir} does not exist')
|
29
|
+
end
|
30
|
+
|
31
|
+
if ::File.exists?(release_vendor)
|
32
|
+
fileutils_output = StringIO.new
|
33
|
+
::FileUtils.fileutils_output = fileutils_output
|
34
|
+
log.debug("Chown Vendor #{release_vendor} to #{deploy_username}.#{deploy_group}")
|
35
|
+
::FileUtils.fileutils_output = fileutils_output
|
36
|
+
result = ::FileUtils.chown_R deploy_username, deploy_group, release_vendor, :verbose => true
|
37
|
+
log.debug(fileutils_output.string)
|
38
|
+
else
|
39
|
+
log.info('Release vendor dir #{release_vendor} does not exist')
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
31
43
|
end
|
32
44
|
end
|
45
|
+
|
46
|
+
module FileUtils
|
47
|
+
def FileUtils.fileutils_output=(new_out)
|
48
|
+
@fileutils_output = new_out
|
49
|
+
end
|
50
|
+
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
require 'net/http'
|
2
|
-
require 'logger'
|
3
2
|
|
4
3
|
module Bib
|
5
4
|
module Opsworks
|
6
5
|
class Newrelic
|
7
6
|
|
7
|
+
include Logging
|
8
|
+
|
8
9
|
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
10
|
|
14
11
|
newrelic_params = prepare_publishing_data(app_name, deploy_data)
|
15
12
|
|
data/lib/bib/opsworks/version.rb
CHANGED