rails_pwnerer 0.4.5 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ v0.4.7. Actually implemented 'console'.
2
+
3
+ v0.4.6. Implemented 'console' and 'scaffold ddns'. Bug fixes across the board. Removed with_dir, switched to block use of Dir.chdir.
4
+
1
5
  v0.4.5. Implemented 'restore'.
2
6
 
3
7
  v0.4. Implemented 'backup'.
data/Manifest CHANGED
@@ -14,7 +14,9 @@ lib/pwnage/config/main.rb
14
14
  lib/pwnage/executor.rb
15
15
  lib/pwnage/scaffolds/dirs.rb
16
16
  lib/pwnage/scaffolds/gems.rb
17
+ lib/pwnage/scaffolds/hook_dyndns.rb
17
18
  lib/pwnage/scaffolds/hook_mongrels.rb
19
+ lib/pwnage/scaffolds/mysql_config.rb
18
20
  lib/pwnage/scaffolds/packages.rb
19
21
  lib/rails_pwnage.rb
20
22
  LICENSE
data/README CHANGED
@@ -4,7 +4,7 @@ I built +rails_pwnerer+ because I hate the messy process of putting a rails
4
4
  application into production. I don't enjoy following 10-page guides, so I'd
5
5
  much rather having ruby do that for me.
6
6
 
7
- Right now, +rails_pwnerer+ assumes a fresh Ubuntu 7.10 installation. You're
7
+ Right now, +rails_pwnerer+ assumes a fresh Ubuntu 8.04 installation. You're
8
8
  welcome to test/update for other systems, and I'll be happy to merge patches,
9
9
  or add you to the RubyForge project.
10
10
 
@@ -22,9 +22,14 @@ I won't even mention backups.
22
22
 
23
23
  Life with +rails_pwnerer+:
24
24
 
25
- 1) Install rubygems:
25
+ 1) Install ruby and rubygems (one command should be enough, but the rubygems in Ubuntu 8.04 doesn't work):
26
+
27
+ sudo apt-get install ruby
28
+
26
29
  sudo apt-get install rubygems
27
30
 
31
+ sudo gem update --system
32
+
28
33
  2) Install +rails_pwnerer+:
29
34
  sudo gem install rails_pwnerer
30
35
 
@@ -37,7 +42,9 @@ sudo rpwn install svn+ssh://your.repository.host/path/to/your_application
37
42
  5) Reboot, or start the services right away:
38
43
  sudo rpwn go live
39
44
 
40
- * Keep your application updated:
45
+ 6) Maintain your application
46
+
47
+ * Push the updates in the SVN repository:
41
48
  sudo rpwn update your_application
42
49
 
43
50
  * Create a backup:
@@ -46,5 +53,11 @@ sudo rpwn backup your_application
46
53
  * Restore from the latest backup:
47
54
  sudo rpwn restore your_application
48
55
 
56
+ * Poke around your application using the Rails console:
57
+ rpwn console your_application
58
+
59
+ * Configure DynDns for your application server
60
+ sudo rpwn scaffold ddns full_host_name ddns_user ddns_password
61
+
49
62
  * Bring down all the applications (panic mode):
50
63
  sudo rpwn go down
data/RUBYFORGE CHANGED
@@ -1,22 +1,25 @@
1
1
  Quickstart for Rubyforge:
2
2
 
3
- 1) Install the rubyforge gem
3
+ 1) Checkout the rails_pwnage code
4
+ svn co svn+ssh://your_user@rubyforge.org/var/svn/rails-pwnage/rails_pwnage
5
+
6
+ 2) Install the rubyforge gem
4
7
  gem install rubyforge
5
8
 
6
- 2) Save your rubyforge.org login information
9
+ 3) Save your rubyforge.org login information
7
10
  rubyforge setup
8
11
 
9
- 3) Get a login cookie
12
+ 4) Get a login cookie
10
13
  rubyforge login
11
14
 
12
- 4) Get project configuration from rubyforge
15
+ 5) Get project configuration from rubyforge
13
16
  rubyforge config rails-pwnage
14
17
 
15
- 5) Create a package to release under
18
+ 6) Create a package to release under
16
19
  rubyforge create_package rails-pwnage rails_pwnage
17
20
 
18
- 6) Install the echoe gem (required for building this gem)
21
+ 7) Install the echoe gem (required for building this gem)
19
22
  gem install echoe
20
23
 
21
- 7) Release the gem (finally!)
24
+ 8) Release the gem (finally!)
22
25
  rake release
@@ -10,7 +10,7 @@ class RailsPwnage::App::ClusterConfig
10
10
  pwnerer_uid = uid_for_username(pwnerer_user)
11
11
  pwnerer_group = group_for_username(pwnerer_user)
12
12
 
13
- with_dir(RailsPwnage::Config.path_to(app_name)) do
13
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
14
14
  %w(log tmp public).each do |writable_dir|
15
15
  FileUtils.chown_R(pwnerer_uid, pwnerer_group, writable_dir)
16
16
  end
@@ -25,7 +25,7 @@ class RailsPwnage::App::ClusterConfig
25
25
  instances = RailsPwnage::Config.app_instances(app_name)
26
26
  first_port = RailsPwnage::Config.app_port0(app_name)
27
27
 
28
- with_dir(app_path) do
28
+ Dir.chdir(app_path) do
29
29
  # create the mongrel_cluster configuration
30
30
  system "mongrel_rails cluster::configure -e production -N #{instances} -p #{first_port} -a 127.0.0.1 -c #{app_path} --user #{pwnerer_user} --group #{pwnerer_group}"
31
31
 
@@ -38,7 +38,7 @@ class RailsPwnage::App::ClusterConfig
38
38
  # silently die if the app was completely busted
39
39
  return unless File.exists? RailsPwnage::Config.path_to(app_name)
40
40
 
41
- with_dir(RailsPwnage::Config.path_to(app_name)) do
41
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
42
42
  system 'mongrel_rails cluster::stop'
43
43
 
44
44
  # clean up PID files in case the mongrels died and left them behind
@@ -50,7 +50,7 @@ class RailsPwnage::App::ClusterConfig
50
50
  # silently die if the app was completely busted
51
51
  return unless File.exists? RailsPwnage::Config.path_to(app_name)
52
52
 
53
- with_dir(RailsPwnage::Config.path_to(app_name)) do
53
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
54
54
  system 'mongrel_rails cluster::start'
55
55
  end
56
56
  end
@@ -69,7 +69,7 @@ class RailsPwnage::App::ClusterConfig
69
69
  start_mongrels(app_name)
70
70
  end
71
71
 
72
- def backup(app_name, action)
72
+ def manage(app_name, action)
73
73
  case action
74
74
  when :checkpoint
75
75
  # nothing to do here
@@ -96,8 +96,8 @@ class RailsPwnage::App::ClusterConfig
96
96
  self.new.update(app_name, &update_proc)
97
97
  end
98
98
 
99
- def self.backup(app_name, action)
100
- self.new.backup(app_name, action)
99
+ def self.manage(app_name, action)
100
+ self.new.manage(app_name, action)
101
101
  end
102
102
 
103
103
  def self.control_all(action = :start)
@@ -11,7 +11,7 @@ class RailsPwnage::App::Database
11
11
  db_user = RailsPwnage::Config.app_db_user(app_name)
12
12
  db_pass = RailsPwnage::Config.app_db_password(app_name)
13
13
 
14
- with_dir(RailsPwnage::Config.path_to(app_name)) do
14
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
15
15
  # put together the admin script
16
16
  case action
17
17
  when :create
@@ -53,7 +53,7 @@ ENDSQL
53
53
 
54
54
  # migrates the database to the latest schema version
55
55
  def migrate_database(app_name)
56
- with_dir(RailsPwnage::Config.path_to(app_name)) do
56
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
57
57
  # now migrate the database
58
58
  system "rake db:migrate RAILS_ENV=production"
59
59
  end
@@ -71,7 +71,7 @@ ENDSQL
71
71
 
72
72
  timestamp = Time.now.strftime '%Y%m%d%H%M%S'
73
73
  dump_file = "db/#{app_name}_#{timestamp}.sql"
74
- with_dir(RailsPwnage::Config.path_to(:backup, app_name)) do
74
+ Dir.chdir(RailsPwnage::Config.path_to(:backup, app_name)) do
75
75
  system "mysqldump --add-drop-database --add-drop-table --extended-insert --single-transaction -u#{db_user} -p#{db_pass} #{db_name} > #{dump_file}"
76
76
  # lockdown the file
77
77
  File.chmod(0400, dump_file)
@@ -85,7 +85,7 @@ ENDSQL
85
85
  db_user = RailsPwnage::Config.app_db_user(app_name)
86
86
  db_pass = RailsPwnage::Config.app_db_password(app_name)
87
87
 
88
- with_dir(RailsPwnage::Config.path_to(:backup, app_name)) do
88
+ Dir.chdir(RailsPwnage::Config.path_to(:backup, app_name)) do
89
89
  # find the latest dump and load it in
90
90
  dump_file = Dir.glob("db/#{app_name}_*").max
91
91
  system "mysql -u#{db_user} -p#{db_pass} #{db_name} < #{dump_file}"
@@ -93,18 +93,20 @@ ENDSQL
93
93
  end
94
94
 
95
95
  def setup(app_name)
96
+ control_boot_script('mysql', :start)
96
97
  admin_database app_name, :create
97
98
  configure_rails app_name
98
99
  migrate_database app_name
99
100
  end
100
101
 
101
102
  def update(app_name)
103
+ control_boot_script('mysql', :start)
102
104
  configure_rails app_name
103
105
  migrate_database app_name
104
106
  end
105
107
 
106
108
  # backs up or restores the database
107
- def backup(app_name, action)
109
+ def manage(app_name, action)
108
110
 
109
111
  case action
110
112
  when :checkpoint
@@ -135,8 +137,8 @@ ENDSQL
135
137
  self.new.update(app_name)
136
138
  end
137
139
 
138
- def self.backup(app_name, action)
139
- self.new.backup(app_name, action)
140
+ def self.manage(app_name, action)
141
+ self.new.manage(app_name, action)
140
142
  end
141
143
 
142
144
  def self.control_all(action = :start)
@@ -9,28 +9,30 @@ module RailsPwnage::App
9
9
 
10
10
  # update an application (restart servers if necessary)
11
11
  def self.update(app_name)
12
- ClusterConfig.update(app_name) do
13
- Svn.update(app_name)
14
- Database.update(app_name)
12
+ ClusterConfig.update app_name do
13
+ Svn.update app_name
14
+ Database.update app_name
15
15
  end
16
- NginxConfig.update(app_name)
16
+ NginxConfig.update app_name
17
17
  end
18
18
 
19
- # performs a backup task (checkpoint / release
20
- def self.backup(app_name, action = :checkpoint)
19
+ # performs application management (checkpoint / rollback / console)
20
+ def self.manage(app_name, action = :checkpoint)
21
21
  case action
22
22
  when :checkpoint
23
- ClusterConfig.backup app_name, action
24
- Svn.backup app_name, action
25
- ClusterConfig.update(app_name) do
26
- Database.backup app_name, action
23
+ ClusterConfig.manage app_name, action
24
+ Svn.manage app_name, action
25
+ ClusterConfig.update app_name do
26
+ Database.manage app_name, action
27
27
  end
28
28
  when :rollback
29
- ClusterConfig.update(app_name) do
30
- Svn.backup app_name, action
31
- Database.backup app_name, action
32
- ClusterConfig.backup app_name, action
29
+ ClusterConfig.update app_name do
30
+ Svn.manage app_name, action
31
+ Database.manage app_name, action
32
+ ClusterConfig.manage app_name, action
33
33
  end
34
+ when :console
35
+ Svn.manage app_name, action
34
36
  end
35
37
  end
36
38
 
@@ -8,7 +8,7 @@ class RailsPwnage::App::NginxConfig
8
8
  first_port = RailsPwnage::Config.app_port0(app_name)
9
9
  hostname_filter = RailsPwnage::Config.app_servername(app_name)
10
10
 
11
- File.open(RailsPwnage::Config.path_to(:nginx_configs) + File::SEPARATOR + app_name, 'w') do |f|
11
+ File.open(File.join(RailsPwnage::Config.path_to(:nginx_configs), app_name), 'w') do |f|
12
12
  # link to the mongrels
13
13
  f << " upstream #{app_name} {\n"
14
14
  RailsPwnage::Config.app_instances(app_name).times do |instance|
@@ -9,7 +9,7 @@ class RailsPwnage::App::Svn
9
9
  app_name = File.basename(svn_path)
10
10
 
11
11
  prod_apps = RailsPwnage::Config.path_to :prod_apps
12
- with_dir(prod_apps) do
12
+ Dir.chdir(prod_apps) do
13
13
  # checkout application
14
14
  system "svn co #{svn_path} #{app_name}"
15
15
  end
@@ -18,7 +18,7 @@ class RailsPwnage::App::Svn
18
18
  end
19
19
 
20
20
  def svn_update(app_name)
21
- with_dir(RailsPwnage::Config.path_to(app_name)) do
21
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
22
22
  system "svn update"
23
23
  end
24
24
  end
@@ -32,7 +32,7 @@ class RailsPwnage::App::Svn
32
32
  FileUtils.mkpath backup_dir unless File.exists? backup_dir
33
33
  File.chown(pwnerer_uid, pwnerer_gid, backup_dir)
34
34
 
35
- with_dir(RailsPwnage::Config.path_to(:backup, app_name)) do
35
+ Dir.chdir(RailsPwnage::Config.path_to(:backup, app_name)) do
36
36
  ['db', 'files', 'tmp'].each do |subdir|
37
37
  Dir.mkdir subdir unless File.exists? subdir
38
38
  File.chown pwnerer_uid, pwnerer_gid, subdir
@@ -49,7 +49,7 @@ class RailsPwnage::App::Svn
49
49
  timestamp = Time.now.strftime '%Y%m%d%H%M%S'
50
50
  dump_file = "files/#{app_name}_#{timestamp}.tar.gz"
51
51
 
52
- with_dir(RailsPwnage::Config.path_to(:backup, app_name)) do
52
+ Dir.chdir(RailsPwnage::Config.path_to(:backup, app_name)) do
53
53
  # create a cold copy of the application files
54
54
  cold_copy = "tmp#{File::SEPARATOR}#{app_name}"
55
55
  FileUtils.rm_r cold_copy if File.exists? cold_copy
@@ -65,7 +65,7 @@ class RailsPwnage::App::Svn
65
65
  end
66
66
 
67
67
  # pack and protect the cold copy
68
- with_dir 'tmp' do
68
+ Dir.chdir 'tmp' do
69
69
  system "tar -czf ../#{dump_file} #{app_name}"
70
70
  end
71
71
  File.chmod(400, dump_file)
@@ -79,7 +79,7 @@ class RailsPwnage::App::Svn
79
79
  # loads the latest file dump from the backup area
80
80
  def load_files(app_name)
81
81
  dump_file = Dir.glob(RailsPwnage::Config.path_to(:backup, app_name) + File::SEPARATOR + "files/#{app_name}_*").max
82
- with_dir(RailsPwnage::Config.path_to(:prod_apps)) do
82
+ Dir.chdir(RailsPwnage::Config.path_to(:prod_apps)) do
83
83
  # find the latest dump and load it in
84
84
  system "tar -xzf #{dump_file}"
85
85
  end
@@ -90,13 +90,17 @@ class RailsPwnage::App::Svn
90
90
  FileUtils.rm_r RailsPwnage::Config.path_to(app_name) if File.exists? RailsPwnage::Config.path_to(app_name)
91
91
  end
92
92
 
93
- def backup(app_name, action)
93
+ def manage(app_name, action)
94
94
  case action
95
95
  when :checkpoint
96
96
  dump_files app_name
97
97
  when :rollback
98
98
  drop_files app_name
99
99
  load_files app_name
100
+ when :console
101
+ Dir.chdir(RailsPwnage::Config.path_to(app_name)) do
102
+ Kernel.system 'ruby script/console production'
103
+ end
100
104
  end
101
105
  end
102
106
 
@@ -126,8 +130,8 @@ class RailsPwnage::App::Svn
126
130
  self.new.update(app_name)
127
131
  end
128
132
 
129
- def self.backup(app_name, action)
130
- self.new.backup(app_name, action)
133
+ def self.manage(app_name, action)
134
+ self.new.manage(app_name, action)
131
135
  end
132
136
 
133
137
  # TODO: uninstallation
@@ -2,19 +2,7 @@
2
2
 
3
3
  require 'etc'
4
4
 
5
- module RailsPwnage::Base
6
- # runs the associated block within a certain directory
7
- def with_dir(dir)
8
- old_dir = Dir.pwd()
9
- Dir.chdir(dir)
10
-
11
- begin
12
- yield
13
- ensure
14
- Dir.chdir(old_dir)
15
- end
16
- end
17
-
5
+ module RailsPwnage::Base
18
6
  # gets the UID associated with the username
19
7
  def uid_for_username(name)
20
8
  passwd_entry = Etc.getpwnam(name)
@@ -4,19 +4,29 @@ require 'fileutils'
4
4
 
5
5
  module RailsPwnage::Base
6
6
  # TODO: make this work w/o initd (OSX, Windows)
7
+
8
+ # returns the filesystem path to a boot script
9
+ def path_to_boot_script(script_name)
10
+ File.join '', 'etc', 'init.d', script_name
11
+ end
12
+
13
+ # returns the filesystem path to the defaults used by a boot script (or nil if unsupported)
14
+ def path_to_boot_script_defaults(script_name)
15
+ File.join '', 'etc', 'default', script_name
16
+ end
7
17
 
8
18
  # hooks a script into the boot sequence
9
19
  def hook_boot_script(script_location)
10
20
  # copy the script to /etc/init.d and chmod +x
11
- script_name = File.basename(script_location)
12
- target_script = '/etc/init.d/' + script_name
13
- FileUtils.cp(script_location, target_script)
14
- File.chmod(0755, target_script)
21
+ script_name = File.basename script_location
22
+ target_script = path_to_boot_script script_name
23
+ FileUtils.cp script_location, target_script
24
+ File.chmod 0755, target_script
15
25
 
16
26
  # add to boot sequence
17
27
  system "update-rc.d #{script_name} defaults"
18
28
  end
19
-
29
+
20
30
  def control_boot_script(script_name, action = :restart)
21
31
  path_to_script = "/etc/init.d/#{script_name}"
22
32
  case action
@@ -19,6 +19,8 @@ module RailsPwnage::Config
19
19
  when :nginx_configs
20
20
  # the directory containing the nginx config files
21
21
  '/etc/nginx/sites-enabled'
22
+ when :ddclient_config
23
+ '/etc/ddclient.conf'
22
24
  when :backup
23
25
  # the backup directory for an application
24
26
  '/prod/backups/' + app_name
@@ -14,10 +14,19 @@ class RailsPwnage::Executor
14
14
  Packages.go
15
15
  when 'mongrels'
16
16
  HookMongrels.go
17
+ when 'mysql'
18
+ MysqlConfig.go
19
+ when 'ddns'
20
+ if args.length < 5
21
+ print 'Usage: rpwn scaffold ddns host_name user_name user_password'
22
+ else
23
+ HookDyndns.go args[2], args[3], args[4]
24
+ end
17
25
  else
18
26
  Packages.go
19
27
  Gems.go
20
28
  Dirs.go
29
+ MysqlConfig.go
21
30
  HookMongrels.go
22
31
  end
23
32
 
@@ -40,10 +49,12 @@ class RailsPwnage::Executor
40
49
  end
41
50
 
42
51
  when 'backup', 'checkpoint', 'save'
43
- RailsPwnage::App.backup args[1], :checkpoint
52
+ RailsPwnage::App.manage args[1], :checkpoint
44
53
  when 'restore', 'reload', 'recover', 'rollback'
45
- RailsPwnage::App.backup args[1], :rollback
46
-
54
+ RailsPwnage::App.manage args[1], :rollback
55
+ when 'console'
56
+ RailsPwnage::App.manage args[1], :console
57
+
47
58
  else
48
59
  print "Unrecognized command #{args[0]}\n"
49
60
  end
@@ -8,7 +8,7 @@ class RailsPwnage::Scaffolds::Dirs
8
8
  # runner
9
9
  def run
10
10
  pwnerer_uid = uid_for_username(RailsPwnage::Config.pwnerer_user)
11
- with_dir('/') do
11
+ Dir.chdir('/') do
12
12
  [:prod_apps, :prod_config, :prod_backups].map { |k| RailsPwnage::Config.path_to k }.each do |path|
13
13
  FileUtils.mkpath path
14
14
  File.chown(pwnerer_uid, nil, path)
@@ -14,7 +14,7 @@ class RailsPwnage::Scaffolds::Gems
14
14
 
15
15
  def install_tools
16
16
  # TODO: an application should have its own tools
17
- install_gems %w(rmagick mechanize sys-proctable highline echoe)
17
+ install_gems %w(mechanize sys-proctable rmagick pdf-writer highline echoe)
18
18
  end
19
19
 
20
20
  # runner
@@ -0,0 +1,46 @@
1
+ # hooks up the dynamic dns service
2
+
3
+ class RailsPwnage::Scaffolds::HookDyndns
4
+ include RailsPwnage::Base
5
+
6
+ # patches the ddclient boot script and configuration to enable the daemon
7
+ def enable_daemon
8
+ boot_script = File.open(path_to_boot_script('ddclient'), 'r') { |f| f.read }
9
+ boot_script.gsub!(/run_daemon\=false/, 'run_daemon=true')
10
+ File.open(path_to_boot_script('ddclient'), 'w') { |f| f.write boot_script }
11
+
12
+ dd_defaults = File.open(path_to_boot_script_defaults('ddclient'), 'r') { |f| f.read }
13
+ dd_defaults.gsub!(/run_daemon\=\"false\"/, 'run_daemon="true"')
14
+ File.open(path_to_boot_script_defaults('ddclient'), 'w') { |f| f.write dd_defaults }
15
+ end
16
+
17
+ # configures ddclient
18
+ def configure(ddns_hostname, ddns_username, ddns_password)
19
+ File.open(RailsPwnage::Config.path_to(:ddclient_config), 'w') do |f|
20
+ f << <<END_CONFIG
21
+ pid=/var/run/ddclient.pid
22
+ use=web, web=checkip.dyndns.com/, web-skip='IP Address'
23
+
24
+ protocol=dyndns2
25
+ server=members.dyndns.org
26
+
27
+ login=#{ddns_username}
28
+ password='#{ddns_password}'
29
+ #{ddns_hostname}
30
+ END_CONFIG
31
+ end
32
+ end
33
+
34
+ # runner
35
+ def run(ddns_hostname, ddns_username, ddns_password)
36
+ control_boot_script 'ddclient', :stop
37
+ configure ddns_hostname, ddns_username, ddns_password
38
+ enable_daemon
39
+ control_boot_script 'ddclient', :start
40
+ end
41
+
42
+ # standalone runner
43
+ def self.go(ddns_hostname, ddns_username, ddns_password)
44
+ self.new.run ddns_hostname, ddns_username, ddns_password
45
+ end
46
+ end
@@ -21,7 +21,8 @@ class RailsPwnage::Scaffolds::HookMongrels
21
21
 
22
22
  # build the configuration
23
23
  def make_config
24
- Dir.mkdir(RailsPwnage::Config.path_to(:mongrel_configs))
24
+ config_dir = RailsPwnage::Config.path_to(:mongrel_configs)
25
+ Dir.mkdir config_dir unless File.exists? config_dir
25
26
  end
26
27
 
27
28
  # runner
@@ -0,0 +1,15 @@
1
+ # installs the required OS (read: Ubuntu) packages
2
+
3
+ class RailsPwnage::Scaffolds::MysqlConfig
4
+ include RailsPwnage::Base
5
+
6
+ # runner
7
+ def run
8
+ Kernel.system 'ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock'
9
+ end
10
+
11
+ # standalone runner
12
+ def self.go
13
+ self.new.run
14
+ end
15
+ end
@@ -1,20 +1,29 @@
1
- # installs the required OS packages
1
+ # installs the required OS (read: Ubuntu) packages
2
2
 
3
3
  class RailsPwnage::Scaffolds::Packages
4
4
  include RailsPwnage::Base
5
5
 
6
+ # the packages needed to manage the server remotely and instal applications
7
+ def install_management
8
+ install_packages %w(openssh-server subversion ddclient)
9
+ end
10
+
11
+ # packages that are needed by popular gems
6
12
  def install_tools
7
- install_packages %w(openssh-server subversion libmagick10-dev)
13
+ install_packages %w(libmagick9-dev)
8
14
  end
9
15
 
16
+ # the packages comprising ruby
10
17
  def install_ruby
11
- install_packages %w(build-essential ruby rubygems irb)
18
+ install_packages %w(build-essential ruby rubygems ruby1.8-dev irb)
12
19
  end
13
20
 
21
+ # the packages for a mysql server and development libraries
14
22
  def install_mysql
15
23
  install_packages %w(mysql-client mysql-server libmysqlclient15-dev)
16
24
  end
17
25
 
26
+ # the packager for _the_ load balancer (nginx, from Russia with <3)
18
27
  def install_balancer
19
28
  install_packages %w(nginx)
20
29
  end
@@ -22,6 +31,7 @@ class RailsPwnage::Scaffolds::Packages
22
31
  # runner
23
32
  def run
24
33
  update_packages
34
+ install_management
25
35
  install_tools
26
36
  install_ruby
27
37
  install_mysql
data/lib/rails_pwnage.rb CHANGED
@@ -17,6 +17,8 @@ require 'pwnage/executor.rb'
17
17
  require 'pwnage/scaffolds/dirs.rb'
18
18
  require 'pwnage/scaffolds/gems.rb'
19
19
  require 'pwnage/scaffolds/hook_mongrels.rb'
20
+ require 'pwnage/scaffolds/hook_dyndns.rb'
21
+ require 'pwnage/scaffolds/mysql_config.rb'
20
22
  require 'pwnage/scaffolds/packages.rb'
21
23
 
22
24
  require 'pwnage/app/main.rb'
@@ -1,28 +1,28 @@
1
1
 
2
- # Gem::Specification for Rails_pwnerer-0.4.5
2
+ # Gem::Specification for Rails_pwnerer-0.4.7
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{rails_pwnerer}
7
- s.version = "0.4.5"
7
+ s.version = "0.4.7"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Victor Costan"]
13
- s.date = %q{2008-04-14}
13
+ s.date = %q{2008-04-25}
14
14
  s.default_executable = %q{rpwn}
15
15
  s.description = %q{Rails deployment tool/hack.}
16
16
  s.email = %q{victor@costan.us}
17
17
  s.executables = ["rpwn"]
18
- s.extra_rdoc_files = ["bin/rpwn", "CHANGELOG", "lib/pwnage/app/cluster_config.rb", "lib/pwnage/app/database.rb", "lib/pwnage/app/main.rb", "lib/pwnage/app/nginx_config.rb", "lib/pwnage/app/svn.rb", "lib/pwnage/base/dirs.rb", "lib/pwnage/base/gems.rb", "lib/pwnage/base/packages.rb", "lib/pwnage/base/startup.rb", "lib/pwnage/base.rb", "lib/pwnage/config/main.rb", "lib/pwnage/executor.rb", "lib/pwnage/scaffolds/dirs.rb", "lib/pwnage/scaffolds/gems.rb", "lib/pwnage/scaffolds/hook_mongrels.rb", "lib/pwnage/scaffolds/packages.rb", "lib/rails_pwnage.rb", "LICENSE", "README"]
19
- s.files = ["bin/rpwn", "CHANGELOG", "lib/pwnage/app/cluster_config.rb", "lib/pwnage/app/database.rb", "lib/pwnage/app/main.rb", "lib/pwnage/app/nginx_config.rb", "lib/pwnage/app/svn.rb", "lib/pwnage/base/dirs.rb", "lib/pwnage/base/gems.rb", "lib/pwnage/base/packages.rb", "lib/pwnage/base/startup.rb", "lib/pwnage/base.rb", "lib/pwnage/config/main.rb", "lib/pwnage/executor.rb", "lib/pwnage/scaffolds/dirs.rb", "lib/pwnage/scaffolds/gems.rb", "lib/pwnage/scaffolds/hook_mongrels.rb", "lib/pwnage/scaffolds/packages.rb", "lib/rails_pwnage.rb", "LICENSE", "Manifest", "README", "RUBYFORGE", "rails_pwnerer.gemspec"]
18
+ s.extra_rdoc_files = ["bin/rpwn", "CHANGELOG", "lib/pwnage/app/cluster_config.rb", "lib/pwnage/app/database.rb", "lib/pwnage/app/main.rb", "lib/pwnage/app/nginx_config.rb", "lib/pwnage/app/svn.rb", "lib/pwnage/base/dirs.rb", "lib/pwnage/base/gems.rb", "lib/pwnage/base/packages.rb", "lib/pwnage/base/startup.rb", "lib/pwnage/base.rb", "lib/pwnage/config/main.rb", "lib/pwnage/executor.rb", "lib/pwnage/scaffolds/dirs.rb", "lib/pwnage/scaffolds/gems.rb", "lib/pwnage/scaffolds/hook_dyndns.rb", "lib/pwnage/scaffolds/hook_mongrels.rb", "lib/pwnage/scaffolds/mysql_config.rb", "lib/pwnage/scaffolds/packages.rb", "lib/rails_pwnage.rb", "LICENSE", "README"]
19
+ s.files = ["bin/rpwn", "CHANGELOG", "lib/pwnage/app/cluster_config.rb", "lib/pwnage/app/database.rb", "lib/pwnage/app/main.rb", "lib/pwnage/app/nginx_config.rb", "lib/pwnage/app/svn.rb", "lib/pwnage/base/dirs.rb", "lib/pwnage/base/gems.rb", "lib/pwnage/base/packages.rb", "lib/pwnage/base/startup.rb", "lib/pwnage/base.rb", "lib/pwnage/config/main.rb", "lib/pwnage/executor.rb", "lib/pwnage/scaffolds/dirs.rb", "lib/pwnage/scaffolds/gems.rb", "lib/pwnage/scaffolds/hook_dyndns.rb", "lib/pwnage/scaffolds/hook_mongrels.rb", "lib/pwnage/scaffolds/mysql_config.rb", "lib/pwnage/scaffolds/packages.rb", "lib/rails_pwnage.rb", "LICENSE", "Manifest", "README", "RUBYFORGE", "rails_pwnerer.gemspec"]
20
20
  s.has_rdoc = true
21
21
  s.homepage = %q{http://www.costan.us/rails_pwnage}
22
22
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rails_pwnerer", "--main", "README"]
23
23
  s.require_paths = ["lib"]
24
24
  s.rubyforge_project = %q{rails-pwnage}
25
- s.rubygems_version = %q{1.1.0}
25
+ s.rubygems_version = %q{1.1.1}
26
26
  s.summary = %q{Rails deployment tool/hack.}
27
27
  end
28
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_pwnerer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-14 00:00:00 -04:00
12
+ date: 2008-04-25 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -36,7 +36,9 @@ extra_rdoc_files:
36
36
  - lib/pwnage/executor.rb
37
37
  - lib/pwnage/scaffolds/dirs.rb
38
38
  - lib/pwnage/scaffolds/gems.rb
39
+ - lib/pwnage/scaffolds/hook_dyndns.rb
39
40
  - lib/pwnage/scaffolds/hook_mongrels.rb
41
+ - lib/pwnage/scaffolds/mysql_config.rb
40
42
  - lib/pwnage/scaffolds/packages.rb
41
43
  - lib/rails_pwnage.rb
42
44
  - LICENSE
@@ -58,7 +60,9 @@ files:
58
60
  - lib/pwnage/executor.rb
59
61
  - lib/pwnage/scaffolds/dirs.rb
60
62
  - lib/pwnage/scaffolds/gems.rb
63
+ - lib/pwnage/scaffolds/hook_dyndns.rb
61
64
  - lib/pwnage/scaffolds/hook_mongrels.rb
65
+ - lib/pwnage/scaffolds/mysql_config.rb
62
66
  - lib/pwnage/scaffolds/packages.rb
63
67
  - lib/rails_pwnage.rb
64
68
  - LICENSE
@@ -93,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
97
  requirements: []
94
98
 
95
99
  rubyforge_project: rails-pwnage
96
- rubygems_version: 1.1.0
100
+ rubygems_version: 1.1.1
97
101
  signing_key:
98
102
  specification_version: 2
99
103
  summary: Rails deployment tool/hack.