BibOpsworks 0.0.9.1 → 0.0.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f8fcefbe64119ea8ff05c10ef4969d75cd67c72
4
- data.tar.gz: b328e472f877330a5a728353e97bb8bd79b6ad81
3
+ metadata.gz: 03f789efcc970f9d677060d426366dbbbdfcef3d
4
+ data.tar.gz: 02e26ec6980af2b0af24b6759b585118a38366d4
5
5
  SHA512:
6
- metadata.gz: 73349a33ff6ae1026f198456e252b769c4260e2d717216dbccf02984bcf163e64039c138c3ab72538749feedc3a448d567be5acf015815b60faeadf98ac966e3
7
- data.tar.gz: 9dfc2d6d1c08ce7523d6d6894dfd4b26e34d5dbede263efb187acc15880caf6bc5d7d6a667dc8251e50dcd11381c2ca0691bab9c3af51798772bf92bc4540d3c
6
+ metadata.gz: cb182e5e551115833de3f2b10b12c13b8c320c271c7b9dedd073cb298d77df71e70a6bcf11596347b8a8eeeb2784ccb7571b490aa2b4668fae6d9c9ccf96ed14
7
+ data.tar.gz: 95f78ee76e5e733c2bd56720b33faa7acd8ea573c39f8bb5ce47eb1b2838461627e80466062f80b1fdc2f2387f57d9d248aee61e8dbf525aff26c19f57777888
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- BibOpsworks (0.0.9)
4
+ BibOpsworks (0.0.9.2)
5
5
  json
6
6
 
7
7
  GEM
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 'logger'
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
- log.debug("Chown Vendor #{release_vendor} to #{deploy_username}.#{deploy_group}")
28
- result = ::FileUtils.chown_R deploy_username, deploy_group, release_vendor, :verbose => true if ::File.exists?(release_vendor)
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
 
@@ -1,5 +1,5 @@
1
1
  module Bib
2
2
  module Opsworks
3
- VERSION = "0.0.9.1"
3
+ VERSION = "0.0.9.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: BibOpsworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.1
4
+ version: 0.0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - fh