solutious-rudy 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module Rudy; module Routines;
13
13
  # explicitly so we do it for linux too for fun.
14
14
  homedir = rbox.guess_user_home(routine.adduser.to_s)
15
15
  args = [:m, :d, homedir, :s, '/bin/bash', routine.adduser.to_s]
16
- puts command_separator(rbox.preview_command(:useradd, args), rbox.user)
16
+ puts command_separator(rbox.preview_command(:useradd, args), rbox.user, rbox.host)
17
17
 
18
18
  # NOTE: We'll may to use platform specific code here.
19
19
  # Linux has adduser and useradd commands:
@@ -27,7 +27,7 @@ module Rudy; module Routines;
27
27
  (!routine.authorize.nil? && !routine.authorize.to_s.empty?)
28
28
  end
29
29
  def authorize(routine, machine, rbox)
30
- puts command_separator(:authorize_keys_remote, rbox.user)
30
+ puts command_separator(:authorize_keys_remote, rbox.user, rbox.host)
31
31
  trap_rbox_errors { rbox.authorize_keys_remote(routine.authorize) }
32
32
  end
33
33
 
@@ -4,18 +4,17 @@ module Rudy; module Routines;
4
4
  class Passthrough < Rudy::Routines::Base
5
5
 
6
6
  def init(*args)
7
- @routine_name = args.first
8
- @routine = fetch_routine_config(@routine_name)
7
+ @routine = fetch_routine_config(@cmdname)
9
8
  end
10
9
 
11
10
  # * +each_mach+ is an optional block which is executed between
12
11
  # disk creation and the after scripts. The will receives two
13
12
  # arguments: instances of Rudy::Machine and Rye::Box.
14
13
  def execute(&each_mach)
15
- routine_separator(@routine_name)
14
+ routine_separator(@cmdname)
16
15
  machines = []
17
16
  generic_machine_runner(:list) do |machine,rbox|
18
- puts $/ #, "[routine: #{@routine_name}]"
17
+ puts $/ #, "[routine: #{@cmdname}]"
19
18
  machines << machine
20
19
  end
21
20
  machines
@@ -23,14 +22,15 @@ module Rudy; module Routines;
23
22
 
24
23
  # Called by generic_machine_runner
25
24
  def raise_early_exceptions
26
- raise Rudy::Error, "No routine name" unless @routine_name
27
- raise NoRoutine, @routine_name unless @routine
28
- rmach = Rudy::Machines.new
29
- raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
25
+ raise Rudy::Error, "No routine name" unless @cmdname
26
+ raise NoRoutine, @cmdname unless @routine
27
+ # TODO: enable this for EC2 groups only
28
+ #raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
30
29
  raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
31
- #if !@@global.offline && !rmach.running?
32
- # raise MachineGroupNotRunning, current_machine_group
33
- #end
30
+ ##rmach = Rudy::Machines.new
31
+ ##if !@@global.offline && !rmach.running?
32
+ ## raise MachineGroupNotRunning, current_machine_group
33
+ ##end
34
34
  end
35
35
 
36
36
  end
@@ -48,7 +48,7 @@ module Rudy; module Routines;
48
48
 
49
49
 
50
50
  if Rudy::Routines::DiskHelper.disks?(@routine) # disk
51
- puts task_separator("DISKS")
51
+ task_separator("DISKS")
52
52
  if rbox.ostype == "sunos"
53
53
  puts "Sorry, Solaris is not supported yet!"
54
54
  else
@@ -4,7 +4,7 @@ module Rudy; module Routines;
4
4
  class Startup < Rudy::Routines::Base
5
5
 
6
6
  def init(*args)
7
- @routine = fetch_routine_config(:startup)
7
+ @routine = fetch_routine_config(:startup) # NOTE: could use @cmdname here
8
8
  end
9
9
 
10
10
  # * +each_mach+ is an optional block which is executed between
data/rudy.gemspec CHANGED
@@ -1,27 +1,26 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "rudy"
3
3
  s.rubyforge_project = 'rudy'
4
- s.version = "0.8.2"
4
+ s.version = "0.8.3"
5
5
  s.summary = "Rudy: Not your grandparents' EC2 deployment tool."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
8
8
  s.email = "delano@solutious.com"
9
9
  s.homepage = "http://github.com/solutious/rudy"
10
10
 
11
- s.extra_rdoc_files = %w[README.rdoc Rudyfile LICENSE.txt CHANGES.txt ]
11
+ s.extra_rdoc_files = %w[README.rdoc Rudyfile LICENSE.txt CHANGES.txt]
12
12
  s.has_rdoc = true
13
13
  s.rdoc_options = ["--line-numbers", "--title", s.summary, "--main", "README.rdoc"]
14
14
  s.require_paths = %w[lib]
15
15
  s.rubygems_version = '1.1.1'
16
16
 
17
17
  s.add_dependency 'drydock', '>= 0.6.3'
18
- s.add_dependency 'caesars', '>= 0.6.6'
19
- s.add_dependency 'rye', '>= 0.6.5'
18
+ s.add_dependency 'caesars', '>= 0.6.8'
19
+ s.add_dependency 'rye', '>= 0.7.3'
20
20
  s.add_dependency 'sysinfo', '>= 0.5.1'
21
21
  s.add_dependency 'storable', '>= 0.5.2'
22
- s.add_dependency 'annoy', '>= 0.5.0'
22
+ s.add_dependency 'annoy', '>= 0.5.1'
23
23
 
24
- s.add_dependency 'grit'
25
24
  s.add_dependency 'echoe'
26
25
  s.add_dependency 'amazon-ec2', '>= 0.3.8' # Region fix
27
26
  s.add_dependency 'aws-s3', '>= 0.6.1' # Ruby 1.9.1 compatability
@@ -49,13 +48,6 @@
49
48
  bin/rudy-ec2
50
49
  bin/rudy-s3
51
50
  bin/rudy-sdb
52
- examples/README.md
53
- examples/debian-sinatra-passenger/commands.rb
54
- examples/debian-sinatra-passenger/machines.rb
55
- examples/debian-sinatra-passenger/routines.rb
56
- examples/debian-sinatra-thin/commands.rb
57
- examples/debian-sinatra-thin/machines.rb
58
- examples/debian-sinatra-thin/routines.rb
59
51
  lib/rudy.rb
60
52
  lib/rudy/aws.rb
61
53
  lib/rudy/aws/ec2.rb
@@ -112,9 +104,6 @@
112
104
  lib/rudy/routines/reboot.rb
113
105
  lib/rudy/routines/shutdown.rb
114
106
  lib/rudy/routines/startup.rb
115
- lib/rudy/scm.rb
116
- lib/rudy/scm/git.rb
117
- lib/rudy/scm/svn.rb
118
107
  lib/rudy/utils.rb
119
108
  rudy.gemspec
120
109
  support/mailtest
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solutious-rudy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.6
33
+ version: 0.6.8
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rye
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.6.5
43
+ version: 0.7.3
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: sysinfo
@@ -70,17 +70,7 @@ dependencies:
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 0.5.0
74
- version:
75
- - !ruby/object:Gem::Dependency
76
- name: grit
77
- type: :runtime
78
- version_requirement:
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: "0"
73
+ version: 0.5.1
84
74
  version:
85
75
  - !ruby/object:Gem::Dependency
86
76
  name: echoe
@@ -147,13 +137,6 @@ files:
147
137
  - bin/rudy-ec2
148
138
  - bin/rudy-s3
149
139
  - bin/rudy-sdb
150
- - examples/README.md
151
- - examples/debian-sinatra-passenger/commands.rb
152
- - examples/debian-sinatra-passenger/machines.rb
153
- - examples/debian-sinatra-passenger/routines.rb
154
- - examples/debian-sinatra-thin/commands.rb
155
- - examples/debian-sinatra-thin/machines.rb
156
- - examples/debian-sinatra-thin/routines.rb
157
140
  - lib/rudy.rb
158
141
  - lib/rudy/aws.rb
159
142
  - lib/rudy/aws/ec2.rb
@@ -210,9 +193,6 @@ files:
210
193
  - lib/rudy/routines/reboot.rb
211
194
  - lib/rudy/routines/shutdown.rb
212
195
  - lib/rudy/routines/startup.rb
213
- - lib/rudy/scm.rb
214
- - lib/rudy/scm/git.rb
215
- - lib/rudy/scm/svn.rb
216
196
  - lib/rudy/utils.rb
217
197
  - rudy.gemspec
218
198
  - support/mailtest
data/examples/README.md DELETED
@@ -1,10 +0,0 @@
1
- # Rudy Configuration Examples
2
-
3
- *NOTE: The examples are a work in progress*
4
-
5
- ## Contributions
6
-
7
- I'm very open to contributions! Rudy supports all Linux-based platforms (with partial Solaris support) and software (rails, sinatra, MySQL, PostgreSQL, etc...) so it's possible to write examples for pretty much anything. If you're interested in writing new examples, I'll gladly accept them and include them here (with credit of course!).
8
-
9
-
10
-
@@ -1,19 +0,0 @@
1
- # ----------------------------------------------------------- COMMANDS --------
2
- # The commands block defines shell commands that can be used in routines. The
3
- # ones defined here are added to the default list defined by Rye::Cmd (Rudy
4
- # executes all SSH commands via Rye).
5
- #
6
- # Usage:
7
- #
8
- # allow COMMAND-NAME
9
- # allow COMMAND-NAME, '/path/2/COMMAND'
10
- # allow COMMAND-NAME, '/path/2/COMMAND', 'default argument', 'another arg'
11
- #
12
- commands do
13
- allow :apt_get, "apt-get", :y, :q
14
- allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
15
- allow :gem_sources, "/usr/bin/gem", "sources"
16
- allow :passenger_install_apache2, "passenger-install-apache2-module", '--auto'
17
- allow :passenger_install_nginx, "passenger-install-nginx-module", '--auto', '--autodownload'
18
- allow :apache2ctl
19
- end
@@ -1,32 +0,0 @@
1
-
2
- # --------------------------------------------------------- MACHINES --------
3
- # The machines block describes the "physical" characteristics
4
- # of your environments.
5
- machines do
6
-
7
- # We've defined an environment called "stage" with one role: "app".
8
- # The configuration inside the env block is available to all its
9
- # roles. The configuration inside the role blocks is available only
10
- # to machines in that specific role.
11
- env :dev, :stage, :prod do
12
- ami "ami-e348af8a" # Debian 5.0 32-bit, Alestic
13
- size 'm1.small'
14
-
15
- role :app do
16
- # You can define disks for the stage-app machines. Rudy uses
17
- # this configuration when it executes a routine (see below).
18
- disks do
19
- path "/rudy/disk1" do
20
- size 10
21
- device "/dev/sdr"
22
- fstype 'ext3'
23
- end
24
- end
25
-
26
- end
27
-
28
- end
29
-
30
- end
31
-
32
-
@@ -1,30 +0,0 @@
1
-
2
- routines do
3
-
4
- sysupdate do
5
- script :root do
6
- apt_get "update"
7
- apt_get "install", "build-essential", "git-core"
8
- apt_get "install", "sqlite3", "libsqlite3-dev"
9
- apt_get "install", "ruby1.8-dev", "rubygems"
10
- apt_get "install", "nginx"
11
- apt_get "install", "apache2-mpm-prefork", "apache2-prefork-dev", "libapr1-dev"
12
- apt_get "install", "libfcgi-dev", "libfcgi-ruby1.8"
13
- gem_sources :a, "http://gems.github.com"
14
- end
15
- end
16
-
17
- installdeps do
18
- script :root do
19
- gem_install "test-spec", "rspec", "camping", "fcgi", "memcache-client"
20
- gem_install "rake", "passenger"
21
- passenger_install_apache2
22
- passenger_install_nginx
23
- gem_install "rack", :v, "0.9.1" # 0.9.1 required by sinatra
24
- gem_install "sinatra"
25
- end
26
- end
27
-
28
-
29
-
30
- end
@@ -1,17 +0,0 @@
1
- # ----------------------------------------------------------- COMMANDS --------
2
- # The commands block defines shell commands that can be used in routines. The
3
- # ones defined here are added to the default list defined by Rye::Cmd (Rudy
4
- # executes all SSH commands via Rye).
5
- #
6
- # Usage:
7
- #
8
- # allow COMMAND-NAME
9
- # allow COMMAND-NAME, '/path/2/COMMAND'
10
- # allow COMMAND-NAME, '/path/2/COMMAND', 'default argument', 'another arg'
11
- #
12
- commands do
13
- allow :apt_get, "apt-get", :y, :q
14
- allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
15
- allow :gem_sources, "/usr/bin/gem", "sources"
16
- allow :thin, "/usr/local/bin/thin", :d, :R, './config.ru', :l, './thin.log', :P, './thin.pid'
17
- end
@@ -1,35 +0,0 @@
1
- # THIS EXAMPLE IS INCOMPLETE -- 2009-05-03
2
-
3
- # --------------------------------------------------------- MACHINES --------
4
- # The machines block describes the "physical" characteristics
5
- # of your environments.
6
- machines do
7
-
8
- # We've defined an environment called "stage" with one role: "app".
9
- # The configuration inside the env block is available to all its
10
- # roles. The configuration inside the role blocks is available only
11
- # to machines in that specific role.
12
- env :dev, :stage, :prod do
13
- ami "ami-e348af8a" # Debian 5.0 32-bit, Alestic
14
- size 'm1.small'
15
-
16
- role :app do
17
- #positions 2
18
-
19
- # You can define disks for the stage-app machines. Rudy uses
20
- # this configuration when it executes a routine (see below).
21
- disks do
22
- path "/rudy/disk1" do
23
- size 10
24
- device "/dev/sdr"
25
- fstype 'ext2'
26
- end
27
- end
28
-
29
- end
30
-
31
- end
32
-
33
- end
34
-
35
-
@@ -1,72 +0,0 @@
1
- # THIS EXAMPLE IS INCOMPLETE -- 2009-05-03
2
-
3
- # Rudy -- debian-sinatra-thin
4
- #
5
- # Notes:
6
- # * Change :rudy to the name of your user remote deployment user
7
- #
8
- sinatra_home = "/rudy/disk1/sinatra"
9
- routines do
10
-
11
- sysupdate do
12
- script :root do
13
- apt_get "update"
14
- apt_get "install", "build-essential", "git-core"
15
- apt_get "install", "sqlite3", "libsqlite3-dev"
16
- apt_get "install", "ruby1.8-dev", "rubygems"
17
- apt_get "install", "apache2-prefork-dev", "libapr1-dev"
18
- apt_get "install", "libfcgi-dev", "libfcgi-ruby1.8"
19
- gem_sources :a, "http://gems.github.com"
20
- end
21
- end
22
-
23
- installdeps do
24
- script :root do
25
- gem_install "test-spec", "rspec", "camping", "fcgi", "memcache-client"
26
- gem_install "mongrel"
27
- gem_install 'ruby-openid', :v, "2.0.4" # thin requires 2.0.x
28
- gem_install "rack", :v, "0.9.1"
29
- gem_install "macournoyer-thin" # need 1.1.0 which works with rack 0.9.1
30
- gem_install "sinatra"
31
- end
32
- end
33
-
34
- environment :dev, :stage do
35
-
36
- startup do
37
- adduser :rudy
38
- authorize :rudy
39
- disks do
40
- create "/rudy/disk1"
41
- end
42
- end
43
- shutdown do
44
- disks do
45
- destroy "/rudy/disk1"
46
- end
47
- end
48
-
49
- restart do
50
- after :rudy do
51
- thin :c, sinatra_home, "restart"
52
- end
53
- end
54
- start do
55
- after :rudy do
56
- thin :c, sinatra_home, "start"
57
- end
58
- end
59
- stop do
60
- after :rudy do
61
- thin :c, sinatra_home, "stop"
62
- end
63
- end
64
-
65
-
66
- end
67
-
68
- end
69
-
70
-
71
-
72
-
data/lib/rudy/scm.rb DELETED
@@ -1,75 +0,0 @@
1
-
2
-
3
- module Rudy
4
- module SCM
5
-
6
- class NotAWorkingCopy < Rudy::Error
7
- def message
8
- "Not the root directory of a #{@obj} working copy"
9
- end
10
- end
11
- class CannotCreateTag < Rudy::Error
12
- def message
13
- "There was an unknown problem creating a release tag (#{@obj})"
14
- end
15
- end
16
- class DirtyWorkingCopy < Rudy::Error
17
- def message
18
- "Please commit local #{@obj} changes"
19
- end
20
- end
21
- class RemoteError < Rudy::Error; end
22
- class NoRemoteURI < Rudy::Error; end
23
- class TooManyTags < Rudy::Error
24
- def message; "Too many tag creation attempts!"; end
25
- end
26
- class NoRemotePath < Rudy::Error
27
- def message
28
- "Add a path for #{@obj} in your routines config"
29
- end
30
- end
31
-
32
-
33
- module ObjectBase
34
-
35
-
36
- def raise_early_exceptions; raise "override raise_early_exceptions"; end
37
-
38
- # copied from routines/helper.rb
39
- def trap_rbox_errors(ret=nil, &command)
40
- begin
41
- ret = command.call
42
- puts ' ' << ret.stdout.join("#{$/} ") if !ret.stdout.empty?
43
- print_response(ret)
44
- rescue Rye::CommandError => ex
45
- print_response(ex)
46
- exit 12 unless keep_going?
47
- rescue Rye::CommandNotFound => ex
48
- STDERR.puts " CommandNotFound: #{ex.message}".color(:red)
49
- STDERR.puts ex.backtrace
50
- exit 12 unless keep_going?
51
- end
52
-
53
- ret
54
- end
55
-
56
-
57
- private
58
- def keep_going?
59
- Annoy.pose_question(" Keep going?\a ", /yes|y|ya|sure|you bet!/i, STDERR)
60
- end
61
-
62
- def print_response(rap)
63
- [:stderr].each do |sumpin|
64
- next if rap.send(sumpin).empty?
65
- STDERR.puts " #{sumpin}: #{rap.send(sumpin).join("#{$/} ")}".color(:red)
66
- end
67
- STDERR.puts " Exit code: #{rap.exit_code}".color(:red) if rap.exit_code != 0
68
- end
69
-
70
- end
71
-
72
- end
73
- end
74
-
75
- Rudy::Utils.require_glob(RUDY_LIB, 'rudy', 'scm', '*.rb')