solutious-rudy 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +19 -1
- data/README.rdoc +66 -35
- data/Rakefile +1 -0
- data/Rudyfile +97 -6
- data/bin/ird +7 -4
- data/bin/rudy +120 -212
- data/bin/rudy-ec2 +240 -0
- data/bin/rudy-s3 +76 -0
- data/bin/rudy-sdb +67 -0
- data/lib/annoy.rb +61 -18
- data/lib/console.rb +10 -5
- data/lib/rudy/aws/ec2/address.rb +76 -40
- data/lib/rudy/aws/ec2/group.rb +138 -78
- data/lib/rudy/aws/ec2/image.rb +134 -12
- data/lib/rudy/aws/ec2/instance.rb +116 -89
- data/lib/rudy/aws/ec2/keypair.rb +26 -14
- data/lib/rudy/aws/ec2/snapshot.rb +23 -12
- data/lib/rudy/aws/ec2/volume.rb +198 -202
- data/lib/rudy/aws/ec2/zone.rb +77 -0
- data/lib/rudy/aws/ec2.rb +56 -25
- data/lib/rudy/aws/s3.rb +54 -0
- data/lib/rudy/aws/sdb/error.rb +46 -0
- data/lib/rudy/aws/sdb.rb +298 -0
- data/lib/rudy/aws.rb +29 -57
- data/lib/rudy/{metadata/backup.rb → backup.rb} +8 -8
- data/lib/rudy/cli/aws/ec2/addresses.rb +105 -0
- data/lib/rudy/cli/aws/ec2/candy.rb +208 -0
- data/lib/rudy/cli/aws/ec2/groups.rb +121 -0
- data/lib/rudy/cli/aws/ec2/images.rb +196 -0
- data/lib/rudy/cli/aws/ec2/instances.rb +194 -0
- data/lib/rudy/cli/aws/ec2/keypairs.rb +53 -0
- data/lib/rudy/cli/aws/ec2/snapshots.rb +49 -0
- data/lib/rudy/cli/aws/ec2/volumes.rb +104 -0
- data/lib/rudy/cli/aws/ec2/zones.rb +22 -0
- data/lib/rudy/cli/aws/s3/buckets.rb +50 -0
- data/lib/rudy/cli/aws/s3/store.rb +22 -0
- data/lib/rudy/cli/aws/sdb/domains.rb +41 -0
- data/lib/rudy/cli/{deploy.rb → candy.rb} +2 -6
- data/lib/rudy/cli/config.rb +25 -20
- data/lib/rudy/cli/disks.rb +18 -108
- data/lib/rudy/cli/machines.rb +94 -0
- data/lib/rudy/cli/routines.rb +47 -70
- data/lib/rudy/cli.rb +104 -89
- data/lib/rudy/config/objects.rb +5 -43
- data/lib/rudy/config.rb +8 -24
- data/lib/rudy/disks.rb +248 -0
- data/lib/rudy/global.rb +121 -0
- data/lib/rudy/huxtable.rb +232 -147
- data/lib/rudy/machines.rb +245 -0
- data/lib/rudy/metadata.rb +136 -0
- data/lib/rudy/routines/helpers/diskhelper.rb +101 -0
- data/lib/rudy/routines/helpers/scripthelper.rb +91 -0
- data/lib/rudy/routines/release.rb +27 -8
- data/lib/rudy/routines/shutdown.rb +47 -32
- data/lib/rudy/routines/startup.rb +47 -37
- data/lib/rudy/routines.rb +30 -37
- data/lib/rudy/scm/svn.rb +1 -1
- data/lib/rudy/utils.rb +262 -4
- data/lib/rudy.rb +76 -248
- data/lib/storable.rb +19 -16
- data/lib/sysinfo.rb +1 -1
- data/rudy.gemspec +88 -68
- data/support/rudy-ec2-startup +5 -5
- data/test/05_config/00_setup_test.rb +3 -7
- data/test/20_sdb/00_setup_test.rb +2 -17
- data/test/20_sdb/10_domains_test.rb +18 -16
- data/test/25_ec2/00_setup_test.rb +5 -10
- data/test/25_ec2/10_keypairs_test.rb +13 -5
- data/test/25_ec2/20_groups_test.rb +48 -56
- data/test/25_ec2/30_addresses_test.rb +13 -10
- data/test/25_ec2/40_volumes_test.rb +11 -8
- data/test/25_ec2/50_snapshots_test.rb +17 -12
- data/test/26_ec2_instances/00_setup_test.rb +3 -8
- data/test/26_ec2_instances/10_instances_test.rb +21 -19
- data/test/30_sdb_metadata/00_setup_test.rb +2 -9
- data/test/30_sdb_metadata/10_disks_test.rb +47 -37
- data/test/30_sdb_metadata/20_backups_test.rb +9 -9
- data/test/helper.rb +5 -3
- data/vendor/highline-1.5.1/CHANGELOG +222 -0
- data/vendor/highline-1.5.1/INSTALL +35 -0
- data/vendor/highline-1.5.1/LICENSE +7 -0
- data/vendor/highline-1.5.1/README +63 -0
- data/vendor/highline-1.5.1/Rakefile +82 -0
- data/vendor/highline-1.5.1/TODO +6 -0
- data/vendor/highline-1.5.1/examples/ansi_colors.rb +38 -0
- data/vendor/highline-1.5.1/examples/asking_for_arrays.rb +18 -0
- data/vendor/highline-1.5.1/examples/basic_usage.rb +75 -0
- data/vendor/highline-1.5.1/examples/color_scheme.rb +32 -0
- data/vendor/highline-1.5.1/examples/limit.rb +12 -0
- data/vendor/highline-1.5.1/examples/menus.rb +65 -0
- data/vendor/highline-1.5.1/examples/overwrite.rb +19 -0
- data/vendor/highline-1.5.1/examples/page_and_wrap.rb +322 -0
- data/vendor/highline-1.5.1/examples/password.rb +7 -0
- data/vendor/highline-1.5.1/examples/trapping_eof.rb +22 -0
- data/vendor/highline-1.5.1/examples/using_readline.rb +17 -0
- data/vendor/highline-1.5.1/lib/highline/color_scheme.rb +120 -0
- data/vendor/highline-1.5.1/lib/highline/compatibility.rb +17 -0
- data/vendor/highline-1.5.1/lib/highline/import.rb +43 -0
- data/vendor/highline-1.5.1/lib/highline/menu.rb +395 -0
- data/vendor/highline-1.5.1/lib/highline/question.rb +463 -0
- data/vendor/highline-1.5.1/lib/highline/system_extensions.rb +193 -0
- data/vendor/highline-1.5.1/lib/highline.rb +758 -0
- data/vendor/highline-1.5.1/setup.rb +1360 -0
- data/vendor/highline-1.5.1/test/tc_color_scheme.rb +56 -0
- data/vendor/highline-1.5.1/test/tc_highline.rb +823 -0
- data/vendor/highline-1.5.1/test/tc_import.rb +54 -0
- data/vendor/highline-1.5.1/test/tc_menu.rb +429 -0
- data/vendor/highline-1.5.1/test/ts_all.rb +15 -0
- metadata +81 -69
- data/lib/aws_sdb/error.rb +0 -42
- data/lib/aws_sdb/service.rb +0 -215
- data/lib/aws_sdb.rb +0 -3
- data/lib/rudy/aws/simpledb.rb +0 -71
- data/lib/rudy/cli/addresses.rb +0 -85
- data/lib/rudy/cli/backups.rb +0 -175
- data/lib/rudy/cli/domains.rb +0 -17
- data/lib/rudy/cli/groups.rb +0 -77
- data/lib/rudy/cli/images.rb +0 -111
- data/lib/rudy/cli/instances.rb +0 -142
- data/lib/rudy/cli/keypairs.rb +0 -47
- data/lib/rudy/cli/manager.rb +0 -51
- data/lib/rudy/cli/release.rb +0 -174
- data/lib/rudy/cli/volumes.rb +0 -121
- data/lib/rudy/command/addresses.rb +0 -69
- data/lib/rudy/command/backups.rb +0 -65
- data/lib/rudy/command/disks-old.rb +0 -322
- data/lib/rudy/command/disks.rb +0 -9
- data/lib/rudy/command/domains.rb +0 -34
- data/lib/rudy/command/groups.rb +0 -118
- data/lib/rudy/command/instances.rb +0 -278
- data/lib/rudy/command/keypairs.rb +0 -149
- data/lib/rudy/command/manager.rb +0 -65
- data/lib/rudy/command/volumes.rb +0 -127
- data/lib/rudy/metadata/disk.rb +0 -149
- data/lib/rudy/metadata/machine.rb +0 -34
- data/lib/rudy/routines/disk_handler.rb +0 -190
- data/lib/rudy/routines/script_runner.rb +0 -65
- data/test/50_commands/00_setup_test.rb +0 -11
- data/test/50_commands/10_keypairs_test.rb +0 -79
- data/test/50_commands/20_groups_test.rb +0 -77
- data/test/50_commands/40_volumes_test.rb +0 -55
- data/test/50_commands/50_instances_test.rb +0 -110
- data/tryouts/console_tryout.rb +0 -91
- data/tryouts/disks.rb +0 -55
- data/tryouts/nested_methods.rb +0 -36
- data/tryouts/session_tryout.rb +0 -46
data/CHANGES.txt
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
RUDY, CHANGES
|
2
2
|
|
3
|
+
* TODO: Remove string messages for non-string output formats
|
4
|
+
* TODO: Support for reserved instances
|
5
|
+
* TODO: Test for zone and region support
|
6
|
+
* TODO: Support for machine image attributes
|
7
|
+
* TODO: Support for product codes
|
8
|
+
* TODO: HTTPS
|
9
|
+
|
10
|
+
|
11
|
+
#### 0.6.0 (2009-04-19) ###############################
|
12
|
+
|
13
|
+
NOTE: This is a significant re-write from 0.5
|
14
|
+
|
15
|
+
* CHANGE: Rebuilt Rudy::AWS::*
|
16
|
+
* CHANGE: Removed lib/rudy/commands/* and lib/rudy/metadata/*
|
17
|
+
* ADDED: rudy-ec2 executable
|
18
|
+
* CHANGE: have local copies of Caesars and Drydock to reduce external dependencies.
|
19
|
+
* ADDED: new output formats: yaml, json, csv, tsv
|
20
|
+
|
3
21
|
|
4
22
|
#### 0.5.1 (2009-04-10) ###############################
|
5
23
|
|
@@ -17,7 +35,7 @@ NOTE: This is a significant re-write from 0.4
|
|
17
35
|
* ADDED: --nocolor option
|
18
36
|
* ADDED: Ruby API
|
19
37
|
* ADDED: Tests with 55% coverage
|
20
|
-
* ADDED: Ruby API (Rudy::
|
38
|
+
* ADDED: Ruby API (Rudy::Machines, etc...)
|
21
39
|
* ADDED: ird, a REPL (experimental)
|
22
40
|
* ADDED: Now uses Rye 0.4.1
|
23
41
|
|
data/README.rdoc
CHANGED
@@ -1,44 +1,66 @@
|
|
1
|
-
= Rudy - v0.
|
1
|
+
= Rudy - v0.6 ALPHA
|
2
2
|
|
3
|
-
Rudy is a development and deployment tool for Amazon
|
3
|
+
Rudy is a command-line development and deployment tool for Amazon Web Services. It helps you build and manage machines in EC2 by organizing them into groups of _environments_ and _roles_. These are called _machine groups_. <tt>stage</tt> is the default environment and <tt>app</tt> is the default role. You can run multiple machines with the same role. These are called _positions_. Rudy also supports running machine groups across availability _zones_.
|
4
4
|
|
5
|
-
|
5
|
+
When you put all this together, you have a unique name for every machine. The default machine is:
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
zone env role
|
8
|
+
v v v
|
9
|
+
m-us-east-1b-stage-app-01
|
10
|
+
^ ^
|
11
|
+
"machine" position
|
11
12
|
|
13
|
+
All configuration is organized into the zones, environments, and roles that you specify (Rudy assumes positions are identical which is important for backups and scaling). And as you'd expect, the defaults can be changed too (in <tt>~/.rudy/config</tt>). See below for usage examples.
|
14
|
+
|
15
|
+
<b>NOTE: This is an ALPHA release. That means Rudy's not ready for production use! See Alpha Warning.</b>
|
12
16
|
|
13
17
|
== Installation
|
14
18
|
|
15
|
-
=== Step 1 (get Rudy on to your machine):
|
19
|
+
=== Step 1 of 2 (get Rudy on to your machine):
|
16
20
|
|
17
21
|
Via Rubygems, one of:
|
18
22
|
|
19
|
-
|
20
|
-
|
23
|
+
$ sudo gem install rudy
|
24
|
+
$ sudo gem install solutious-rudy --source http://gems.github.com/
|
25
|
+
|
26
|
+
or via download:
|
27
|
+
* rudy-0.6.0.tar.gz[http://github.com/solutious/rudy/tarball/rudy-0.6.0]
|
28
|
+
* rudy-0.6.0.zip[http://github.com/solutious/rudy/zipball/rudy-0.6.0]
|
29
|
+
|
30
|
+
NOTE: <em>If you are not installing via RubyGems, you need to make sure the Ruby dependencies are in your LOAD_PATH (<tt>$:</tt>). Ryan Tomayko wrote a gist[http://gist.github.com/54177] about it.</em>
|
31
|
+
|
32
|
+
=== Step 2 of 2 (initialize your configuration):
|
33
|
+
|
34
|
+
$ rudy generate-config
|
35
|
+
[edit ~/.rudy/config with your Amazon Web Services credentials]
|
36
|
+
$ rudy init
|
37
|
+
|
38
|
+
NOTE: <em>You need an Amazon[http://aws.amazon.com/] account to use Rudy. Sign up for EC2[http://aws.amazon.com/ec2/], SimpleDB[http://aws.amazon.com/simpledb/], and S3[http://aws.amazon.com/s3/]</em>
|
39
|
+
|
40
|
+
|
41
|
+
== Example -- Launch a Machine Group
|
42
|
+
|
43
|
+
Machine groups are named after the current environment and role. The default machine group is <tt>stage-app</tt>. In this example, Rudy will create the default machine group from scratch.
|
21
44
|
|
22
|
-
|
23
|
-
$ git clone git://github.com/solutious/rudy.git
|
45
|
+
<b>Note: Make sure your <tt>~/.rudy/config</tt> contains your AWS credentials</b>
|
24
46
|
|
25
|
-
|
26
|
-
* rudy-0.5.1.tar.gz[http://github.com/solutious/rudy/tarball/rudy-0.5.1]
|
27
|
-
* rudy-0.5.1.zip[http://github.com/solutious/rudy/zipball/rudy-0.5.1]
|
47
|
+
We need to tell Rudy what this machine group should look like. We can generate a default machine configuration with this command:
|
28
48
|
|
29
|
-
|
49
|
+
$ rudy config --rudy > Rudyfile
|
30
50
|
|
31
|
-
|
51
|
+
This will generate a config file called <tt>Rudyfile</tt> which contains a default machines and routines configuration. The machine configuration describes the "physical" characteristics of your machine groups. The routine configuration describes what happens when you startup and shutdown a machine group (Rudy refers to these as _routines_).
|
52
|
+
|
53
|
+
We can launch the default machine group (stage-app) with this command:
|
32
54
|
|
33
|
-
|
34
|
-
[modify ~/.rudy/config]
|
35
|
-
$ rudy init
|
55
|
+
$ rudy startup
|
36
56
|
|
37
|
-
|
57
|
+
You now have a new EC2 instance called <tt>m-us-east-1b-stage-app-01</tt> to work with. You can log into it with:
|
38
58
|
|
39
|
-
|
40
|
-
|
41
|
-
|
59
|
+
$ rudy -u root ssh
|
60
|
+
|
61
|
+
The <tt>-u root</tt> tells Rudy to open a connection as the root user. If you create an account on that instance, you can login as that user too. When you don't feel like paying for the instance you can run the following command to destroy it forever:
|
62
|
+
|
63
|
+
$ rudy shutdown
|
42
64
|
|
43
65
|
|
44
66
|
== Dependencies:
|
@@ -47,45 +69,54 @@ NOTE: If your are not installing via RubyGems, you will need to make sure the Ru
|
|
47
69
|
* Net::SSH[http://net-ssh.rubyforge.org/]
|
48
70
|
* Net::SCP[http://net-ssh.rubyforge.org/]
|
49
71
|
* amazon-ec2[http://github.com/grempe/amazon-ec2]
|
50
|
-
* aws_sdb[http://rubyforge.org/projects/aws-sdb/]
|
51
|
-
* Drydock[http://github.com/delano/drydock]
|
52
|
-
* Caesars[http://github.com/delano/caesars]
|
53
72
|
* Rye[http://github.com/delano/rye]
|
54
73
|
|
55
74
|
|
56
75
|
== Common Errors
|
57
76
|
|
58
|
-
* <tt
|
77
|
+
* <tt>"`require': no such file to load -- amazon-ec2 (LoadError)"</tt>
|
59
78
|
* You're probably running a mix of Rubygem and non-Rubygem libraries. Ryan Tomayko has you covered: http://gist.github.com/54177
|
60
|
-
|
61
|
-
* <tt>The request signature we calculated does not match the signature you provided.</tt>
|
79
|
+
* <tt>"The request signature we calculated does not match the signature you provided."</tt>
|
62
80
|
* Check that your Amazon Web Service access key and secret key are correct
|
81
|
+
* <tt>"AWS was not able to validate the provided access credentials"</tt>
|
82
|
+
* If it's a new Amazon Account, you need to sign up for EC2, SDB, and S3.
|
83
|
+
|
84
|
+
== Alpha Warning
|
85
|
+
|
86
|
+
Although Rudy has been pretty well tested and is currently being used in production in a private beta, it's not ready for general production use. There are a few things to keep in mind while Rudy is in alpha status.
|
63
87
|
|
64
|
-
*
|
65
|
-
|
88
|
+
* If you already have private SSH keys, back them up. Rudy is quite safe but hasn't been audited so backup your keys as a precaution.
|
89
|
+
* If you're running EC2 instances in production, create a new set of AWS credentials (access key and secret key) to use with Rudy. This will ensure that Rudy has no access to your production instances.
|
90
|
+
* Rudy commands and APIs may change in later releases. This means that if you create an environment with an alpha release and later upgrade Rudy, some things may not work as expected.
|
66
91
|
|
67
92
|
|
68
93
|
== More Info
|
69
94
|
|
70
95
|
* GitHub[http://github.com/solutious/rudy]
|
96
|
+
* Issues[http://github.com/solutious/rudy/issues]
|
71
97
|
* RubyForge[http://rubyforge.org/projects/rudy]
|
72
98
|
* Inspiration[http://www.youtube.com/watch?v=CgaiIW5Rzes]
|
73
99
|
|
74
100
|
|
75
101
|
== Thanks
|
76
102
|
|
77
|
-
* The Rilli.com team -- for the initial use case, the ongoing feedback and support, and the good times!
|
103
|
+
* The Rilli.com[http://rilli.com] team -- for the initial use case, the ongoing feedback and support, and the good times!
|
78
104
|
* Adam Bognar
|
79
105
|
* Andrew Simpson
|
80
106
|
* Caleb Buxton
|
81
107
|
* Colin Brumelle
|
108
|
+
* Everyone at Utrecht.rb[http://groups.google.com/group/utrecht-rb]
|
109
|
+
* Jamis Buck for writing Net::SSH and friends.
|
82
110
|
|
83
111
|
|
84
112
|
== Credits
|
85
113
|
|
86
|
-
*
|
114
|
+
* Rudy::AWS::SDB adapted from aws_sdb by Tim Dysinger (http://dysinger.net)
|
115
|
+
* Escape, Copyright (C) 2006,2007 Tanaka Akira <akr@fsij.org>
|
87
116
|
* Keshia Knight Pulliam (rudy@solutious.com)
|
88
|
-
|
117
|
+
* Delano Mandelbaum (delano@solutious.com)
|
118
|
+
|
119
|
+
|
89
120
|
== License
|
90
121
|
|
91
122
|
See: LICENSE.txt
|
data/Rakefile
CHANGED
@@ -152,6 +152,7 @@ Rake::RDocTask.new do |t|
|
|
152
152
|
t.rdoc_files.include('LICENSE.txt')
|
153
153
|
t.rdoc_files.include('README.rdoc')
|
154
154
|
t.rdoc_files.include('CHANGES.txt')
|
155
|
+
#t.rdoc_files.include('Rudyfile') # why is the formatting f'd?
|
155
156
|
t.rdoc_files.include('bin/*')
|
156
157
|
t.rdoc_files.include('lib/**/*.rb')
|
157
158
|
end
|
data/Rudyfile
CHANGED
@@ -1,23 +1,26 @@
|
|
1
|
-
#
|
2
|
-
#
|
1
|
+
# = Rudy
|
2
|
+
#
|
3
|
+
# This is an example Rudy configuration.
|
3
4
|
#
|
4
5
|
# Rudy automatically looks for configuration files in the
|
5
|
-
# following locations:
|
6
|
+
# following locations (in this order):
|
6
7
|
#
|
7
8
|
# ~/.rudy/config
|
8
9
|
# ./.rudy/config
|
9
|
-
#
|
10
|
-
# ./.rudy/*.rb
|
10
|
+
#
|
11
11
|
# ./Rudyfile
|
12
12
|
# ./config/rudy/*.rb
|
13
|
+
# ./.rudy/*.rb
|
14
|
+
# /etc/rudy/*.rb
|
13
15
|
#
|
14
16
|
# When multuple files are found, the configuration is
|
15
17
|
# NOT OVERRIDDEN. It's ADDED / APPENDED. This means you can
|
16
18
|
# split configuration across many files as you please.
|
17
19
|
#
|
18
20
|
# There are three sections: accounts, defaults, machines.
|
21
|
+
#
|
19
22
|
# By convention, accounts and defaults go in ~/.rudy/config or ./.rudy/config
|
20
|
-
#
|
23
|
+
# machines configuration goes in ./Rudyfile or ./config/rudy/machines.rb
|
21
24
|
|
22
25
|
|
23
26
|
# --------------------------------------------------------- MACHINES --------
|
@@ -25,4 +28,92 @@
|
|
25
28
|
# of your environments.
|
26
29
|
machines do
|
27
30
|
|
31
|
+
users do
|
32
|
+
# If you already have private keys for logging in to your EC2 instances
|
33
|
+
# EC2 instances you can specify them here and Rudy will use these instead.
|
34
|
+
# root :keypair => "/#{Rudy.sysinfo.home}/.rudy/root-private-key"
|
35
|
+
end
|
36
|
+
|
37
|
+
zone :"us-east-1b" do
|
38
|
+
ami 'ami-235fba4a' # Amazon Getting Started AMI (US)
|
39
|
+
end
|
40
|
+
zone :"eu-west-1b" do
|
41
|
+
ami 'ami-e40f2790' # Amazon Getting Started AMI (EU)
|
42
|
+
end
|
43
|
+
|
44
|
+
# We've defined an environment called "stage" with one role: "app".
|
45
|
+
# The configuration inside the env block is available to all its
|
46
|
+
# roles. The configuration inside the role blocks is available only
|
47
|
+
# to machines in that specific role.
|
48
|
+
env :stage do
|
49
|
+
ami "ami-5394733a" # ec2onrails/ec2onrails-v0_9_9_1-i386.manifest.xml
|
50
|
+
size 'm1.small'
|
51
|
+
|
52
|
+
role :app do
|
53
|
+
positions 1
|
54
|
+
|
55
|
+
# We define two disks for the stage-app machines
|
56
|
+
disks do
|
57
|
+
path "/rudy/disk1" do
|
58
|
+
size 2
|
59
|
+
device "/dev/sdr"
|
60
|
+
end
|
61
|
+
path "/rudy/disk2" do
|
62
|
+
size 1
|
63
|
+
device "/dev/sdm"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
role :SUCCESS do
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
# The routines section below contains calls to local and remote
|
77
|
+
# scripts. The config contained in this block is made available
|
78
|
+
# those scripts in the form of a yaml file. The file is called
|
79
|
+
# rudy-config.yml.
|
80
|
+
config do
|
81
|
+
dbmaster 'localhost'
|
82
|
+
newparam 573114
|
83
|
+
end
|
84
|
+
|
85
|
+
|
28
86
|
end
|
87
|
+
|
88
|
+
# ----------------------------------------------------------- ROUTINES --------
|
89
|
+
# The routines block describes the repeatable processes for each machine group.
|
90
|
+
routines do
|
91
|
+
|
92
|
+
env :stage do
|
93
|
+
role :app do
|
94
|
+
|
95
|
+
startup do
|
96
|
+
before_local Rudy.sysinfo.user => :uname
|
97
|
+
|
98
|
+
disks do
|
99
|
+
create "/rudy/disk1"
|
100
|
+
end
|
101
|
+
|
102
|
+
after :root => [:uname, :a]
|
103
|
+
after :root => [:touch, '/rudy/disk1/rudy-was-here']
|
104
|
+
after_local Rudy.sysinfo.user => :date
|
105
|
+
end
|
106
|
+
|
107
|
+
shutdown do
|
108
|
+
before :root => '/a/nonexistent/script'
|
109
|
+
before :root => :uptime
|
110
|
+
|
111
|
+
disks do
|
112
|
+
destroy "/rudy/disk1"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
data/bin/ird
CHANGED
@@ -8,6 +8,9 @@
|
|
8
8
|
#
|
9
9
|
|
10
10
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place
|
11
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'vendor', 'highline-1.5.1', 'lib')
|
12
|
+
%w{drydock caesars rye}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
|
13
|
+
require 'rubygems'
|
11
14
|
|
12
15
|
# SEE: http://github.com/rubyspec/matzruby/blob/a34130eb7c4ecc164115a59aa1b76c643bd98202/lib/irb/xmp.rb
|
13
16
|
# SEE: http://github.com/blackwinter/wirble/tree/master
|
@@ -19,7 +22,7 @@ require 'drydock'
|
|
19
22
|
require 'rudy/cli'
|
20
23
|
|
21
24
|
|
22
|
-
module
|
25
|
+
module RudyCLI_Interactive # :nodoc:all
|
23
26
|
extend self
|
24
27
|
extend Drydock
|
25
28
|
include Readline
|
@@ -28,7 +31,7 @@ module CLI
|
|
28
31
|
global :S, :secretkey, String, "AWS Secret Access Key"
|
29
32
|
#global :R, :region, String, "Connect to a specific EC2 region (ie: #{Rudy::DEFAULT_REGION})"
|
30
33
|
#global :n, :nocolor, "Disable output colors"
|
31
|
-
global :f, :config, String, "Specify another configuration file to read (ie: #{Rudy::
|
34
|
+
global :f, :config, String, "Specify another configuration file to read (ie: #{Rudy::CONFIG_FILE})"
|
32
35
|
global :z, :zone, String, "Connect to a specific EC2 zone (ie: #{Rudy::DEFAULT_ZONE})"
|
33
36
|
global :e, :environment, String, "Connect to the specified environment (ie: #{Rudy::DEFAULT_ENVIRONMENT})"
|
34
37
|
global :r, :role, String, "Connect to a machine with the specified role (ie: #{Rudy::DEFAULT_ROLE})"
|
@@ -46,12 +49,12 @@ module CLI
|
|
46
49
|
|
47
50
|
|
48
51
|
default :interactive
|
49
|
-
debug :
|
52
|
+
debug :off
|
50
53
|
desc "An interactive REPL for Rudy."
|
51
54
|
usage "#{$0} [global options]"
|
52
55
|
command :interactive do |obj|
|
53
56
|
|
54
|
-
@@rmach = Rudy::
|
57
|
+
@@rmach = Rudy::Machines.new(:global => obj.global)
|
55
58
|
@@rkey = Rudy::KeyPairs.new(:global => obj.global)
|
56
59
|
@@rgrp = Rudy::Groups.new(:global => obj.global)
|
57
60
|
@@rvol = Rudy::Volumes.new(:global => obj.global)
|