BibOpsworks 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4c80570e15b0f798a668a7608a8e2a93532533e
4
- data.tar.gz: b63cb613831900e72b64594bd996f6d3d53e5df4
3
+ metadata.gz: 25bb2634ee25cd57e4d84b87d9fa04e20288498b
4
+ data.tar.gz: d819873d9fcee1a5bc38e21c206cda57945c4f37
5
5
  SHA512:
6
- metadata.gz: 93fc04a81b93da672bb6350287773a3b382aab0c44fc34bb08b56d126224647e00ccde039be3b0ee01b90c9924e3d3d088974136c07baab2aae0e1b1c0efea90
7
- data.tar.gz: 9f5619f1631e0850bd20f49eaff2826396ee37c75667e7ab160c604350b8a64e69323f160590496bfb1fb3d542d89fa264b283cdbdbc517eed789fc564b515ea
6
+ metadata.gz: a841871daf62c5895c16b8b6feb04e3c2b162a1dd69e592c7b9a8205cec61c2104fd57abf6653e3a30527f88f631d9252c8302404e9aedcce0561d03ae01245f
7
+ data.tar.gz: bb73abcb8249e55a14d62519cfbc7c41890c96d954cf6784e0efc15e7417b938abe01fd51f3924a6eddd76d23d96e5685ee2b34a3bc185a1e98becac83aeca4f
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'json'
22
+ spec.add_dependency 'hipchat', '1.5.4'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.3'
24
25
  spec.add_development_dependency 'rake'
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- BibOpsworks (0.1.8)
4
+ BibOpsworks (0.2.0)
5
+ hipchat (= 1.5.4)
5
6
  json
6
7
 
7
8
  GEM
@@ -15,8 +16,15 @@ GEM
15
16
  thor (~> 0.19.1)
16
17
  tins (~> 1.6.0)
17
18
  docile (1.1.5)
19
+ hipchat (1.5.4)
20
+ httparty
21
+ mimemagic
22
+ httparty (0.14.0)
23
+ multi_xml (>= 0.5.2)
18
24
  json (1.8.3)
25
+ mimemagic (0.3.2)
19
26
  minitest (5.0.8)
27
+ multi_xml (0.6.0)
20
28
  parser (2.3.1.2)
21
29
  ast (~> 2.2)
22
30
  powerpack (0.1.1)
@@ -52,4 +60,4 @@ DEPENDENCIES
52
60
  rubocop
53
61
 
54
62
  BUNDLED WITH
55
- 1.10.6
63
+ 1.13.7
@@ -3,6 +3,7 @@ require 'bib/opsworks/composer'
3
3
  require 'bib/opsworks/newrelic'
4
4
  require 'bib/opsworks/qafoo'
5
5
  require 'bib/opsworks/google'
6
+ require 'bib/opsworks/hipchat'
6
7
  require 'bib/opsworks/version'
7
8
 
8
9
  class BibOpsworks
@@ -29,6 +30,11 @@ class BibOpsworks
29
30
  google.publish_deployment(app_name, deploy_data, google_ident)
30
31
  end
31
32
 
33
+ def hipchat_publish_deployment(app_name, deploy_data, api_token, room)
34
+ hipchat = Bib::Opsworks::HipChat.new
35
+ hipchat.publish_deployment(app_name, deploy_data, api_token, room)
36
+ end
37
+
32
38
  def version
33
39
  Bib::Opsworks::VERSION
34
40
  end
@@ -0,0 +1,42 @@
1
+ require 'httparty'
2
+ require 'hipchat'
3
+ require 'bib/opsworks/logging'
4
+
5
+ module Bib
6
+ module Opsworks
7
+ class HipChat
8
+ include Logging
9
+
10
+ def publish_deployment(app_name, deploy_data, api_token, room)
11
+ params = prepare_data(app_name, deploy_data)
12
+
13
+ log.debug("HipChat Token: #{api_token}, Room: #{room}")
14
+
15
+ begin
16
+ client = ::HipChat::Client.new(api_token, api_version: 'v2')
17
+ client[room].send('', "Deployment: #{params['name']} to #{params['environment']}", color: 'green')
18
+ rescue StandardError => e
19
+ log.error("Failed to publish deployment to HipChat: #{e}")
20
+ end
21
+ end
22
+
23
+ def prepare_data(app_name, deploy_data)
24
+ scm_revision = deploy_data['scm']['revision']
25
+
26
+ deployment_user = if deploy_data['deploying_user'].nil? || deploy_data['deploying_user'].empty?
27
+ 'opsworks'
28
+ else
29
+ deploy_data['deploying_user'].split('/')[1]
30
+ end
31
+
32
+ name_text = "#{scm_revision} by #{deployment_user}"
33
+
34
+ qafoo_params = {}
35
+ qafoo_params['name'] = name_text
36
+ qafoo_params['environment'] = app_name
37
+ qafoo_params['type'] = 'release'
38
+ qafoo_params
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,5 +1,5 @@
1
1
  module Bib
2
2
  module Opsworks
3
- VERSION = '0.1.8'.freeze
3
+ VERSION = '0.2.0'.freeze
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.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fh
@@ -10,90 +10,104 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-06-20 00:00:00.000000000 Z
13
+ date: 2017-03-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - '>='
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: hipchat
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 1.5.4
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 1.5.4
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: bundler
31
45
  requirement: !ruby/object:Gem::Requirement
32
46
  requirements:
33
- - - "~>"
47
+ - - ~>
34
48
  - !ruby/object:Gem::Version
35
49
  version: '1.3'
36
50
  type: :development
37
51
  prerelease: false
38
52
  version_requirements: !ruby/object:Gem::Requirement
39
53
  requirements:
40
- - - "~>"
54
+ - - ~>
41
55
  - !ruby/object:Gem::Version
42
56
  version: '1.3'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: rake
45
59
  requirement: !ruby/object:Gem::Requirement
46
60
  requirements:
47
- - - ">="
61
+ - - '>='
48
62
  - !ruby/object:Gem::Version
49
63
  version: '0'
50
64
  type: :development
51
65
  prerelease: false
52
66
  version_requirements: !ruby/object:Gem::Requirement
53
67
  requirements:
54
- - - ">="
68
+ - - '>='
55
69
  - !ruby/object:Gem::Version
56
70
  version: '0'
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: minitest
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - "~>"
75
+ - - ~>
62
76
  - !ruby/object:Gem::Version
63
77
  version: 5.0.8
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - "~>"
82
+ - - ~>
69
83
  - !ruby/object:Gem::Version
70
84
  version: 5.0.8
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: coveralls
73
87
  requirement: !ruby/object:Gem::Requirement
74
88
  requirements:
75
- - - ">="
89
+ - - '>='
76
90
  - !ruby/object:Gem::Version
77
91
  version: '0'
78
92
  type: :development
79
93
  prerelease: false
80
94
  version_requirements: !ruby/object:Gem::Requirement
81
95
  requirements:
82
- - - ">="
96
+ - - '>='
83
97
  - !ruby/object:Gem::Version
84
98
  version: '0'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: rubocop
87
101
  requirement: !ruby/object:Gem::Requirement
88
102
  requirements:
89
- - - ">="
103
+ - - '>='
90
104
  - !ruby/object:Gem::Version
91
105
  version: '0'
92
106
  type: :development
93
107
  prerelease: false
94
108
  version_requirements: !ruby/object:Gem::Requirement
95
109
  requirements:
96
- - - ">="
110
+ - - '>='
97
111
  - !ruby/object:Gem::Version
98
112
  version: '0'
99
113
  description:
@@ -103,9 +117,9 @@ executables: []
103
117
  extensions: []
104
118
  extra_rdoc_files: []
105
119
  files:
106
- - ".gitignore"
107
- - ".rubocop.yml"
108
- - ".travis.yml"
120
+ - .gitignore
121
+ - .rubocop.yml
122
+ - .travis.yml
109
123
  - BibOpsworks.gemspec
110
124
  - Gemfile
111
125
  - Gemfile.lock
@@ -115,6 +129,7 @@ files:
115
129
  - lib/bib/opsworks.rb
116
130
  - lib/bib/opsworks/composer.rb
117
131
  - lib/bib/opsworks/google.rb
132
+ - lib/bib/opsworks/hipchat.rb
118
133
  - lib/bib/opsworks/logging.rb
119
134
  - lib/bib/opsworks/newrelic.rb
120
135
  - lib/bib/opsworks/qafoo.rb
@@ -133,17 +148,17 @@ require_paths:
133
148
  - lib
134
149
  required_ruby_version: !ruby/object:Gem::Requirement
135
150
  requirements:
136
- - - ">="
151
+ - - '>='
137
152
  - !ruby/object:Gem::Version
138
153
  version: '0'
139
154
  required_rubygems_version: !ruby/object:Gem::Requirement
140
155
  requirements:
141
- - - ">="
156
+ - - '>='
142
157
  - !ruby/object:Gem::Version
143
158
  version: '0'
144
159
  requirements: []
145
160
  rubyforge_project:
146
- rubygems_version: 2.6.1
161
+ rubygems_version: 2.0.14.1
147
162
  signing_key:
148
163
  specification_version: 4
149
164
  summary: Tools wrapper for AWS Opsworks Deploys