rudy 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -7,7 +7,12 @@ RUDY, CHANGES
7
7
  * TODO: Support for product codes
8
8
  * TODO: HTTPS
9
9
 
10
- #### 0.6.5 (2009-04-??) ###############################
10
+ #### 0.6.6 (2009-04-22) ###############################
11
+
12
+ * ADDED: Better error handling for Rudy::AWS::SDB
13
+ * FIXED: Ruby 1.9.1 compatability (including requiring aws-s3 >=0.6.1)
14
+
15
+ #### 0.6.5 (2009-04-20) ###############################
11
16
 
12
17
  * FIXED: Startup and Shutdown routines now check machine group status first
13
18
  * FIXED: Misc release process issues between 0.6.0 and 0.6.4
data/README.rdoc CHANGED
@@ -33,8 +33,8 @@ Via Rubygems, one of:
33
33
  $ sudo gem install solutious-rudy --source http://gems.github.com/
34
34
 
35
35
  or via download:
36
- * rudy-0.6.4.tar.gz[http://github.com/solutious/rudy/tarball/rudy-0.6.4]
37
- * rudy-0.6.4.zip[http://github.com/solutious/rudy/zipball/rudy-0.6.4]
36
+ * rudy-0.6.6.tar.gz[http://github.com/solutious/rudy/tarball/rudy-0.6.6]
37
+ * rudy-0.6.6.zip[http://github.com/solutious/rudy/zipball/rudy-0.6.6]
38
38
 
39
39
  NOTE: <em>If you are not installing via RubyGems, you need to make sure the dependencies are in your LOAD_PATH (<tt>$:</tt>). Ryan Tomayko wrote a gist[http://gist.github.com/54177] about it.</em>
40
40
 
@@ -85,7 +85,9 @@ The <tt>-u root</tt> tells Rudy to open a connection as the root user. If you cr
85
85
 
86
86
  == Common Errors
87
87
 
88
- * <tt>"`require': no such file to load -- amazon-ec2 (LoadError)"</tt>
88
+ * <tt>"fingerprint ... does not match for 'ec2-11-22-33-44.compute-1.amazonaws.com,11.22.33.44'"</tt>
89
+ * This means the host SSH key for that machine does not match your +~/.ssh/known_hosts+ file. Most EC2 images generate new host SSH keys on the first boot so is the most likely cause for this error message (it's safe to continue). If this is not a new instance, you should tell Rudy not to continue and investigate manually.
90
+ * <tt>"`require': no such file to load -- logger (LoadError)"</tt>
89
91
  * You're probably running a mix of Rubygem and non-Rubygem libraries. Ryan Tomayko has you covered: http://gist.github.com/54177
90
92
  * <tt>"The request signature we calculated does not match the signature you provided."</tt>
91
93
  * Check that your Amazon Web Service access key and secret key are correct
data/Rudyfile CHANGED
@@ -52,8 +52,8 @@ machines do
52
52
 
53
53
 
54
54
  role :app do
55
- positions 2
56
- addresses '174.129.208.127', '174.129.208.169'
55
+ positions 1
56
+ #addresses '11.22.33.44', '55.66.77.88'
57
57
 
58
58
  # We define two disks for the stage-app machines
59
59
  disks do
data/bin/rudy CHANGED
@@ -10,8 +10,8 @@
10
10
 
11
11
  $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place
12
12
  $:.unshift File.join(File.dirname(__FILE__), '..', 'vendor', 'highline-1.5.1', 'lib')
13
- %w{amazon-ec2 rye}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
14
- require 'rubygems'
13
+ #%w{amazon-ec2 rye}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
14
+ #require 'rubygems'
15
15
 
16
16
  #$SAFE = 1 # require is unsafe in Ruby 1.9??
17
17
 
@@ -251,7 +251,7 @@ class RudyCLI < Rudy::CLI::Base
251
251
 
252
252
  # ------------------------------------------- UGLY STUFFS --------
253
253
  # ------------------------------------------------------------------
254
- debug :on
254
+ debug :off
255
255
  default :machines
256
256
 
257
257
 
data/bin/rudy-s3 ADDED
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # = Rudy S3
4
+ #
5
+ # === A Rudy interface to Amazon Simple Storage Service
6
+ #
7
+ #
8
+ #
9
+ # See rudy-s3 -h for usage
10
+ #
11
+
12
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place
13
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'vendor', 'highline-1.5.1', 'lib')
14
+ #%w{amazon-ec2 caesars rye}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
15
+ #require 'rubygems'
16
+
17
+ require 'rudy'
18
+ require 'rudy/cli'
19
+ require 'drydock'
20
+
21
+ # Command-line interface for bin/rudy-s3
22
+ module RudyCLI_S3
23
+ extend Drydock
24
+
25
+ # ------------------------------------ AMAZON S3 COMMANDS --------
26
+ # ------------------------------------------------------------------
27
+
28
+ desc "Amazon S3 Buckets"
29
+ usage "rudy-s3 buckets"
30
+ option :l, :list, "List bucket objects"
31
+ action :C, :create, "Create a bucket"
32
+ action :D, :destroy, "Destroy a bucket"
33
+ argv :name
34
+ command :buckets => Rudy::CLI::AWS::S3::Buckets
35
+ command_alias :buckets, :b
36
+
37
+ #desc "Amazon S3 Storage Interface"
38
+ #usage "rudy-s3 store file-path"
39
+ #option :b, :bucket, String, "Bucket name"
40
+ #argv :path
41
+ #command :store => Rudy::CLI::AWS::S3::Store
42
+ #command_alias :store, :s
43
+
44
+
45
+
46
+ # --------------------------------- RUDY-S3 MISCELLANEOUS --------
47
+ # ------------------------------------------------------------------
48
+
49
+ default :buckets
50
+ debug :off
51
+
52
+
53
+ end
54
+
55
+
56
+ #puts Rudy::Utils.banner("THIS IS RUBY #{RUBY_VERSION}") if Drydock.debug?
57
+
58
+ # We call Drydock specifically otherwise it will run at_exit. Rye also
59
+ # uses at_exit for shutting down the ssh-agent. Ruby executes at_exit
60
+ # blocks in reverse order so if Drydock is required first, it's block
61
+ # will run after Rye shuts down the ssh-agent.
62
+ begin
63
+ Drydock.run!(ARGV, STDIN) if Drydock.run? && !Drydock.has_run?
64
+ rescue Drydock::ArgError, Drydock::OptError=> ex
65
+ STDERR.puts ex.message
66
+ STDERR.puts ex.usage
67
+ rescue Rudy::Error => ex
68
+ STDERR.puts ex.message
69
+ rescue => ex
70
+ STDERR.puts "ERROR (#{ex.class.to_s}): #{ex.message}"
71
+ STDERR.puts ex.backtrace if Drydock.debug?
72
+ rescue SystemExit
73
+ # Don't balk
74
+ end
75
+
76
+
data/lib/rudy/aws/sdb.rb CHANGED
@@ -13,7 +13,8 @@ module Rudy
13
13
  class SDB
14
14
  class NoAccessKey < RuntimeError; end
15
15
  class NoSecretKey < RuntimeError; end
16
-
16
+ include Rudy::AWS::ObjectBase
17
+
17
18
  require 'rudy/aws/sdb/error'
18
19
 
19
20
  def initialize(access_key=nil, secret_key=nil, region=nil, debug=nil)
@@ -94,7 +95,7 @@ module Rudy
94
95
  }
95
96
  params['NextToken'] =
96
97
  token unless token.nil? || token.empty?
97
-
98
+
98
99
  doc = call(:get, params)
99
100
  results = []
100
101
  REXML::XPath.each(doc, "//Item") do |item|
@@ -268,24 +269,31 @@ module Rudy
268
269
  uri = URI.parse(url)
269
270
  @debug.puts("#{url}") if @debug
270
271
 
271
- response =
272
+ response = execute_request(nil) {
272
273
  Net::HTTP.new(uri.host, uri.port).send_request(method, uri.request_uri)
273
- @debug.puts("#{response.code}\n#{response.body}") if @debug
274
- raise(ConnectionError.new(response)) unless (200..400).include?(
275
- response.code.to_i
276
- )
274
+ }
277
275
 
278
- doc = REXML::Document.new(response.body)
279
- error = doc.get_elements('*/Errors/Error')[0]
280
- raise(
281
- Module.class_eval(
282
- "AwsSdb::#{error.get_elements('Code')[0].text}Error"
283
- ).new(
284
- error.get_elements('Message')[0].text,
285
- doc.get_elements('*/RequestID')[0].text
286
- )
287
- ) unless error.nil?
276
+ if !response.nil?
288
277
 
278
+ @debug.puts("#{response.code}\n#{response.body}") if @debug
279
+ raise(ConnectionError.new(response)) unless (200..400).include?(
280
+ response.code.to_i
281
+ )
282
+
283
+
284
+ doc = REXML::Document.new(response.body)
285
+ error = doc.get_elements('*/Errors/Error')[0]
286
+ raise(
287
+ Module.class_eval(
288
+ "AwsSdb::#{error.get_elements('Code')[0].text}Error"
289
+ ).new(
290
+ error.get_elements('Message')[0].text,
291
+ doc.get_elements('*/RequestID')[0].text
292
+ )
293
+ ) unless error.nil?
294
+ else
295
+ doc = nil
296
+ end
289
297
  doc
290
298
  end
291
299
  end
data/lib/rudy/aws.rb CHANGED
@@ -1,8 +1,7 @@
1
1
 
2
2
 
3
- require 'EC2' # What a
4
- #require 'aws_sdb' # motley
5
- # Disabled b/c it's not Ruby 1.9 compatible
3
+ require 'EC2' # A
4
+ require 'aws_sdb' # motley
6
5
  require 'aws/s3' # crew
7
6
 
8
7
  module Rudy
@@ -53,9 +52,9 @@ module Rudy
53
52
  rescue Timeout::Error => ex
54
53
  STDERR.puts "Timeout (#{timeout}): #{ex.message}!"
55
54
  rescue SocketError => ex
56
- STDERR.puts "Socket Error. Check your Internets!"
57
- STDERR.puts ex.message
58
- STDERR.puts ex.backtrace
55
+ raise SocketError, "Check your Internets!"
56
+ #STDERR.puts ex.message
57
+ #STDERR.puts ex.backtrace
59
58
  ensure
60
59
  response ||= default
61
60
  end
data/lib/rudy.rb CHANGED
@@ -9,6 +9,7 @@ require 'digest/md5'
9
9
  require 'stringio'
10
10
  require 'ostruct'
11
11
  require 'yaml'
12
+ require 'logger'
12
13
  require 'socket'
13
14
  require 'timeout'
14
15
  require 'tempfile'
@@ -26,7 +27,6 @@ require 'net/ssh/multi'
26
27
  require 'net/ssh/gateway'
27
28
 
28
29
 
29
- require 'logger'
30
30
 
31
31
  # = Rudy
32
32
  #
@@ -65,7 +65,7 @@ module Rudy
65
65
  unless defined?(MAJOR)
66
66
  MAJOR = 0.freeze
67
67
  MINOR = 6.freeze
68
- TINY = 5.freeze
68
+ TINY = 6.freeze
69
69
  end
70
70
  def self.to_s; [MAJOR, MINOR, TINY].join('.'); end
71
71
  def self.to_f; self.to_s.to_f; end
data/rudy.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "rudy"
3
3
  s.rubyforge_project = 'rudy'
4
- s.version = "0.6.5"
4
+ s.version = "0.6.6"
5
5
  s.summary = "Rudy: Not your grandparent's deployment tool."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
@@ -19,9 +19,10 @@
19
19
  s.add_dependency 'rye', '>= 0.5.3'
20
20
 
21
21
  s.add_dependency 'echoe'
22
- s.add_dependency 'amazon-ec2', '>= 0.3.8' # region fix
23
- s.add_dependency 'net-ssh', '>=2.0.9'
24
- s.add_dependency 'net-scp', '>=1.0.2'
22
+ s.add_dependency 'amazon-ec2', '>= 0.3.8' # Region fix
23
+ s.add_dependency 'aws-s3', '>= 0.6.1' # Ruby 1.9.1 compatability
24
+ s.add_dependency 'net-ssh', '>= 2.0.9'
25
+ s.add_dependency 'net-scp', '>= 1.0.2'
25
26
  s.add_dependency 'net-ssh-gateway'
26
27
  s.add_dependency 'net-ssh-multi'
27
28
 
@@ -31,7 +32,7 @@
31
32
  #s.add_development_dependency('jgre-monkeyspecdoc', '>= 0.1.0')
32
33
  #s.add_development_dependency('thoughtbot-shoulda', '>= 0.1.0')
33
34
 
34
- s.executables = %w[ird rudy rudy-ec2 rudy-sdb]
35
+ s.executables = %w[ird rudy rudy-ec2 rudy-sdb rudy-s3]
35
36
 
36
37
  # = MANIFEST =
37
38
  # git ls-files
@@ -44,6 +45,7 @@
44
45
  bin/ird
45
46
  bin/rudy
46
47
  bin/rudy-ec2
48
+ bin/rudy-s3
47
49
  bin/rudy-sdb
48
50
  lib/annoy.rb
49
51
  lib/console.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-20 00:00:00 -04:00
12
+ date: 2009-04-22 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,16 @@ dependencies:
62
62
  - !ruby/object:Gem::Version
63
63
  version: 0.3.8
64
64
  version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: aws-s3
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 0.6.1
74
+ version:
65
75
  - !ruby/object:Gem::Dependency
66
76
  name: net-ssh
67
77
  type: :runtime
@@ -109,6 +119,7 @@ executables:
109
119
  - rudy
110
120
  - rudy-ec2
111
121
  - rudy-sdb
122
+ - rudy-s3
112
123
  extensions: []
113
124
 
114
125
  extra_rdoc_files:
@@ -125,6 +136,7 @@ files:
125
136
  - bin/ird
126
137
  - bin/rudy
127
138
  - bin/rudy-ec2
139
+ - bin/rudy-s3
128
140
  - bin/rudy-sdb
129
141
  - lib/annoy.rb
130
142
  - lib/console.rb