rudy 0.2.2 → 0.2.3
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.
- data/bin/rudy +5 -3
- data/lib/rudy.rb +1 -1
- data/lib/rudy/command/base.rb +3 -0
- data/lib/rudy/command/images.rb +2 -0
- data/lib/rudy/command/{release.rb → stage.rb} +3 -3
- data/lib/rudy/scm/svn.rb +3 -3
- data/rudy.gemspec +2 -2
- metadata +2 -2
data/bin/rudy
CHANGED
@@ -188,6 +188,8 @@ option :b, :bucket_name, String, "The name of the bucket that will store the ima
|
|
188
188
|
option :C, :create, "Create an image"
|
189
189
|
usage "rudy images [-C -i image -b bucket -a account]"
|
190
190
|
command :images => Rudy::Command::Images do |obj|
|
191
|
+
obj.print_header
|
192
|
+
|
191
193
|
if obj.create
|
192
194
|
puts "Make sure the machine is clean. I don't want archive no crud!"
|
193
195
|
exit unless you_are_sure?
|
@@ -197,13 +199,13 @@ command :images => Rudy::Command::Images do |obj|
|
|
197
199
|
end
|
198
200
|
end
|
199
201
|
|
200
|
-
command :
|
202
|
+
command :stage => Rudy::Command::Stage do |obj|
|
201
203
|
obj.print_header
|
202
204
|
|
203
205
|
raise "No SCM defined. Set RUDY_SVN_BASE or RUDY_GIT_BASE." unless obj.scm
|
204
206
|
|
205
|
-
|
206
|
-
obj.
|
207
|
+
exit unless you_are_sure?
|
208
|
+
obj.push_to_stage
|
207
209
|
|
208
210
|
end
|
209
211
|
|
data/lib/rudy.rb
CHANGED
@@ -33,7 +33,7 @@ module Rudy #:nodoc:
|
|
33
33
|
module VERSION #:nodoc:
|
34
34
|
MAJOR = 0.freeze unless defined? MAJOR
|
35
35
|
MINOR = 2.freeze unless defined? MINOR
|
36
|
-
TINY =
|
36
|
+
TINY = 3.freeze unless defined? TINY
|
37
37
|
def self.to_s
|
38
38
|
[MAJOR, MINOR, TINY].join('.')
|
39
39
|
end
|
data/lib/rudy/command/base.rb
CHANGED
@@ -11,6 +11,8 @@ module Rudy
|
|
11
11
|
|
12
12
|
attr_accessor :access_key
|
13
13
|
attr_accessor :secret_key
|
14
|
+
attr_accessor :accnt_num
|
15
|
+
|
14
16
|
attr_accessor :ec2_cert
|
15
17
|
attr_accessor :ec2_private_key
|
16
18
|
attr_accessor :keypairs
|
@@ -32,6 +34,7 @@ module Rudy
|
|
32
34
|
def init
|
33
35
|
@access_key = ENV['AWS_ACCESS_KEY'] unless @access_key
|
34
36
|
@secret_key = ENV['AWS_SECRET_KEY'] unless @secret_key
|
37
|
+
@account_num = ENV['AWS_ACCOUNT_NUMBER'] unless @account_num
|
35
38
|
|
36
39
|
@ec2_cert = ENV['EC2_CERT'] unless @ec2_cert
|
37
40
|
@ec2_private_key = ENV['EC2_PRIVATE_KEY'] unless @ec2_private_key
|
data/lib/rudy/command/images.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
module Rudy
|
4
4
|
module Command
|
5
|
-
class
|
5
|
+
class Stage < Rudy::Command::Base
|
6
6
|
|
7
7
|
|
8
|
-
def
|
8
|
+
def push_to_stage
|
9
9
|
|
10
10
|
if @user != "root"
|
11
11
|
#puts "This command will be run as root"
|
@@ -21,7 +21,7 @@ module Rudy
|
|
21
21
|
raise "Please start an instance in #{machine_group} before releasing! (rudy -e stage instances --start)" if list.empty?
|
22
22
|
puts "Creating release from: #{Dir.pwd}"
|
23
23
|
|
24
|
-
tag = @scm.
|
24
|
+
tag = @scm.create_release_tag
|
25
25
|
|
26
26
|
machine = list.values.first # NOTE: we're assuming there's only one machine
|
27
27
|
|
data/lib/rudy/scm/svn.rb
CHANGED
@@ -10,7 +10,7 @@ module Rudy
|
|
10
10
|
@base_uri = uri
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def create_release_tag
|
14
14
|
raise "There are local changes. Please revert or check them in!" unless everything_checked_in?
|
15
15
|
raise "Invalid base URI (#{@base_uri}). Check RUDY_SVN_BASE." unless valid_uri?(@base_uri)
|
16
16
|
raise "You must run this command from SVN you want to release from!" unless svn_dir?(Dir.pwd)
|
@@ -18,7 +18,7 @@ module Rudy
|
|
18
18
|
re = `svn info`.match /^URL:\s+(.+)$/
|
19
19
|
release = re[1] if re
|
20
20
|
|
21
|
-
release_tag = "#{@base_uri}/#{
|
21
|
+
release_tag = "#{@base_uri}/#{generate_release_tag_name}"
|
22
22
|
|
23
23
|
puts "Creating tag: #{release_tag}"
|
24
24
|
cmd = "svn copy -m 'Another Release by Rudy!' #{release} #{release_tag}"
|
@@ -28,7 +28,7 @@ module Rudy
|
|
28
28
|
release_tag
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def generate_release_tag_name
|
32
32
|
now = Time.now
|
33
33
|
mon = now.mon.to_s.rjust(2, '0')
|
34
34
|
day = now.day.to_s.rjust(2, '0')
|
data/rudy.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
@spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "rudy"
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.3"
|
4
4
|
s.summary = "Rudy is a handy staging and deployment tool for Amazon EC2."
|
5
5
|
s.description = "Rudy is a handy staging and deployment tool for Amazon EC2."
|
6
6
|
s.author = "Delano Mandelbaum"
|
@@ -30,7 +30,7 @@
|
|
30
30
|
lib/rudy/command/images.rb
|
31
31
|
lib/rudy/command/instances.rb
|
32
32
|
lib/rudy/command/metadata.rb
|
33
|
-
lib/rudy/command/
|
33
|
+
lib/rudy/command/stage.rb
|
34
34
|
lib/rudy/command/volumes.rb
|
35
35
|
lib/rudy/metadata/disk.rb
|
36
36
|
lib/rudy/metadata/environment.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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -43,7 +43,7 @@ files:
|
|
43
43
|
- lib/rudy/command/images.rb
|
44
44
|
- lib/rudy/command/instances.rb
|
45
45
|
- lib/rudy/command/metadata.rb
|
46
|
-
- lib/rudy/command/
|
46
|
+
- lib/rudy/command/stage.rb
|
47
47
|
- lib/rudy/command/volumes.rb
|
48
48
|
- lib/rudy/metadata/disk.rb
|
49
49
|
- lib/rudy/metadata/environment.rb
|