right_support 2.8.20 → 2.8.21

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.8.20
1
+ 2.8.21
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2014 RightScale Inc
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'shellwords'
23
+
24
+ module RightSupport::Deployment
25
+ # Helper for getting information about an application that has been deployed to a server. Currently
26
+ # this only supports apps that are deployed to git repositories. It also relies on some conventions
27
+ # that have been adopted by the RightScale Operations team. If your deploys do not follow these
28
+ # conventions, then this class is of little use to you!
29
+ #
30
+ # In order for Info to be correct, your deployment methodology must adhere to the following three
31
+ # conventions:
32
+ # 1. The locally checked-out branch must track some upstream branch (but doesn't need to be named identically)
33
+ # 2. You should not "git fetch" in the deployed repository after deploy-time
34
+ # 3. If a post-deploy commit is made, the committer's email address must begin with "ops@"
35
+ class Info
36
+ # @return [Array] list of String: descriptions of recent SCM commits (most recent first)
37
+ attr_reader :recent_commits
38
+
39
+ # @return [String] the SHA (or other SCM identifier) of the most recent commit
40
+ attr_reader :head_commit
41
+
42
+ #@param [Fixnum] num_commits how many commits to gather information about
43
+ #@param [String,Pathname] dir location of the app's git repo (or any of its subdirectories)
44
+ def initialize(num_commits=5, dir=Dir.pwd)
45
+ @num_commits = num_commits
46
+ @dir = dir
47
+
48
+
49
+ # For all the services run by Ops, they add an extra commit when they checkout the code. This
50
+ # commit does not indicate the last commit that would be seen in the Git repo anywhere else,
51
+ # so we should ignore this commit whe logging the current repositories state.
52
+ commit_diff = `git --git-dir #{Shellwords.escape(@dir.to_s)}/.git log origin/HEAD..HEAD \
53
+ --pretty=format:'%ae'`.split(/\n+/)
54
+
55
+ ops_commit_exists = (commit_diff.count == 1 && commit_diff.first =~ /ops@/)
56
+ ops_commit_exists ? head_commit = 1 : head_commit = 0
57
+
58
+ @recent_commits = `git --git-dir #{Shellwords.escape(@dir.to_s)}/.git log \
59
+ -n #{Shellwords.escape(@num_commits.to_s)} \
60
+ --pretty=format:'%h %an %ad'`.split(/\n+/)[head_commit..-1]
61
+
62
+ @head_commit = `git --git-dir #{Shellwords.escape(@dir.to_s)}/.git log -n 1 \
63
+ --pretty=format:'%H' #{"HEAD~" if ops_commit_exists}`
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,8 @@
1
+ module RightSupport
2
+ module Deployment
3
+
4
+ end
5
+ end
6
+
7
+ require 'right_support/deployment/info'
8
+
data/lib/right_support.rb CHANGED
@@ -14,4 +14,5 @@ module RightSupport
14
14
  autoload :Config, 'right_support/config'
15
15
  autoload :Stats, 'right_support/stats'
16
16
  autoload :CI, 'right_support/ci'
17
+ autoload :Deployment, 'right_support/deployment'
17
18
  end
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "right_support"
8
- s.version = "2.8.20"
7
+ s.name = %q{right_support}
8
+ s.version = "2.8.21"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tony Spataro", "Sergey Sergyenko", "Ryan Williamson", "Lee Kirchhoff", "Alexey Karpik", "Scott Messier"]
12
- s.date = "2014-03-21"
13
- s.description = "A toolkit of useful, reusable foundation code created by RightScale."
14
- s.email = "support@rightscale.com"
12
+ s.date = %q{2014-04-04}
13
+ s.description = %q{A toolkit of useful, reusable foundation code created by RightScale.}
14
+ s.email = %q{support@rightscale.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.rdoc"
@@ -55,6 +55,8 @@ Gem::Specification.new do |s|
55
55
  "lib/right_support/data/uuid.rb",
56
56
  "lib/right_support/db.rb",
57
57
  "lib/right_support/db/cassandra_model.rb",
58
+ "lib/right_support/deployment.rb",
59
+ "lib/right_support/deployment/info.rb",
58
60
  "lib/right_support/log.rb",
59
61
  "lib/right_support/log/exception_logger.rb",
60
62
  "lib/right_support/log/filter_logger.rb",
@@ -134,31 +136,32 @@ Gem::Specification.new do |s|
134
136
  "spec/validation/openssl_spec.rb",
135
137
  "spec/validation/ssh_spec.rb"
136
138
  ]
137
- s.homepage = "https://github.com/rightscale/right_support"
139
+ s.homepage = %q{https://github.com/rightscale/right_support}
138
140
  s.licenses = ["MIT"]
139
141
  s.require_paths = ["lib"]
140
- s.rubygems_version = "1.8.26"
141
- s.summary = "Reusable foundation code."
142
+ s.rubygems_version = %q{1.3.7}
143
+ s.summary = %q{Reusable foundation code.}
142
144
 
143
145
  if s.respond_to? :specification_version then
146
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
144
147
  s.specification_version = 3
145
148
 
146
149
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
147
150
  s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
148
151
  s.add_development_dependency(%q<flexmock>, ["~> 1.0"])
149
152
  s.add_development_dependency(%q<rspec>, ["~> 2.13.0"])
150
- s.add_development_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
153
+ s.add_development_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
151
154
  else
152
155
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
153
156
  s.add_dependency(%q<flexmock>, ["~> 1.0"])
154
157
  s.add_dependency(%q<rspec>, ["~> 2.13.0"])
155
- s.add_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
158
+ s.add_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
156
159
  end
157
160
  else
158
161
  s.add_dependency(%q<jeweler>, ["~> 2.0"])
159
162
  s.add_dependency(%q<flexmock>, ["~> 1.0"])
160
163
  s.add_dependency(%q<rspec>, ["~> 2.13.0"])
161
- s.add_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
164
+ s.add_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
162
165
  end
163
166
  end
164
167
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_support
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
4
+ hash: 5
5
+ prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 8
9
- - 20
10
- version: 2.8.20
9
+ - 21
10
+ version: 2.8.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Spataro
@@ -20,11 +20,10 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2014-03-21 00:00:00 Z
23
+ date: 2014-04-04 00:00:00 -07:00
24
+ default_executable:
24
25
  dependencies:
25
26
  - !ruby/object:Gem::Dependency
26
- type: :development
27
- name: jeweler
28
27
  version_requirements: &id001 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
@@ -35,11 +34,11 @@ dependencies:
35
34
  - 2
36
35
  - 0
37
36
  version: "2.0"
38
- prerelease: false
37
+ name: jeweler
39
38
  requirement: *id001
40
- - !ruby/object:Gem::Dependency
39
+ prerelease: false
41
40
  type: :development
42
- name: flexmock
41
+ - !ruby/object:Gem::Dependency
43
42
  version_requirements: &id002 !ruby/object:Gem::Requirement
44
43
  none: false
45
44
  requirements:
@@ -50,11 +49,11 @@ dependencies:
50
49
  - 1
51
50
  - 0
52
51
  version: "1.0"
53
- prerelease: false
52
+ name: flexmock
54
53
  requirement: *id002
55
- - !ruby/object:Gem::Dependency
54
+ prerelease: false
56
55
  type: :development
57
- name: rspec
56
+ - !ruby/object:Gem::Dependency
58
57
  version_requirements: &id003 !ruby/object:Gem::Requirement
59
58
  none: false
60
59
  requirements:
@@ -66,14 +65,21 @@ dependencies:
66
65
  - 13
67
66
  - 0
68
67
  version: 2.13.0
69
- prerelease: false
68
+ name: rspec
70
69
  requirement: *id003
71
- - !ruby/object:Gem::Dependency
70
+ prerelease: false
72
71
  type: :development
73
- name: cucumber
72
+ - !ruby/object:Gem::Dependency
74
73
  version_requirements: &id004 !ruby/object:Gem::Requirement
75
74
  none: false
76
75
  requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ hash: 15
79
+ segments:
80
+ - 1
81
+ - 0
82
+ version: "1.0"
77
83
  - - <
78
84
  - !ruby/object:Gem::Version
79
85
  hash: 29
@@ -82,15 +88,10 @@ dependencies:
82
88
  - 3
83
89
  - 3
84
90
  version: 1.3.3
85
- - - ~>
86
- - !ruby/object:Gem::Version
87
- hash: 15
88
- segments:
89
- - 1
90
- - 0
91
- version: "1.0"
92
- prerelease: false
91
+ name: cucumber
93
92
  requirement: *id004
93
+ prerelease: false
94
+ type: :development
94
95
  description: A toolkit of useful, reusable foundation code created by RightScale.
95
96
  email: support@rightscale.com
96
97
  executables: []
@@ -139,6 +140,8 @@ files:
139
140
  - lib/right_support/data/uuid.rb
140
141
  - lib/right_support/db.rb
141
142
  - lib/right_support/db/cassandra_model.rb
143
+ - lib/right_support/deployment.rb
144
+ - lib/right_support/deployment/info.rb
142
145
  - lib/right_support/log.rb
143
146
  - lib/right_support/log/exception_logger.rb
144
147
  - lib/right_support/log/filter_logger.rb
@@ -217,6 +220,7 @@ files:
217
220
  - spec/stats/helpers_spec.rb
218
221
  - spec/validation/openssl_spec.rb
219
222
  - spec/validation/ssh_spec.rb
223
+ has_rdoc: true
220
224
  homepage: https://github.com/rightscale/right_support
221
225
  licenses:
222
226
  - MIT
@@ -246,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
250
  requirements: []
247
251
 
248
252
  rubyforge_project:
249
- rubygems_version: 1.8.15
253
+ rubygems_version: 1.3.7
250
254
  signing_key:
251
255
  specification_version: 3
252
256
  summary: Reusable foundation code.