rails_pwnerer 0.6.38 → 0.6.39

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.6.39. More permissive restore to allow moving data across instances.
2
+
1
3
  v0.6.38. Safer database backup parameters.
2
4
 
3
5
  v0.6.37. Added the curb gem and its lib dependency to the set of scaffolded gems.
data/README CHANGED
@@ -70,6 +70,9 @@ sudo rpwn backup your_application
70
70
  * Restore from the latest backup:
71
71
  sudo rpwn restore your_application
72
72
 
73
+ * Restore the database (but not the application files) from the latest backup:
74
+ sudo rpwn restore_db your_application
75
+
73
76
  * Poke around your application using the Rails console:
74
77
  rpwn console your_application
75
78
 
@@ -119,6 +119,9 @@ ENDSQL
119
119
  Dir.chdir app_config[:backup_path] do
120
120
  # find the latest dump and load it in
121
121
  dump_file = Dir.glob("db/#{app_name}.#{instance_name}_*").max
122
+ unless dump_file
123
+ dump_file = Dir.glob("db/#{app_name}.*").max
124
+ end
122
125
  Kernel.system "mysql -u#{db_user} -p#{db_pass} #{db_name} < #{dump_file}"
123
126
  end
124
127
  end
@@ -61,6 +61,9 @@ class RailsPwnage::App::Files
61
61
  app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
62
62
 
63
63
  dump_file = Dir.glob(File.join(backup_path, "files/#{app_name}.#{instance_name}_*")).max
64
+ unless dump_file
65
+ dump_file = Dir.glob(File.join(backup_path, "files/#{app_name}.*")).max
66
+ end
64
67
  restore_path = Pathname.new(File.join(app_path, '..')).cleanpath.to_s
65
68
  Dir.chdir restore_path do
66
69
  # find the latest dump and load it in
@@ -98,6 +98,13 @@ module RailsPwnage::App
98
98
  mod.new.manage app, instance, action
99
99
  end
100
100
  end
101
+ when :rollback_db
102
+ self.update_app app, instance do
103
+ [Database, ClusterConfig].each do |mod|
104
+ mod.new.manage app, instance, :rollback
105
+ end
106
+ Database.new.manage app, instance, :update
107
+ end
101
108
  when :rekey
102
109
  self.update_app app, instance do
103
110
  [Config, Database].each do |mod|
@@ -68,6 +68,7 @@ class RailsPwnage::App::Git
68
68
  app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
69
69
 
70
70
  FileUtils.rm_rf app_path
71
+ print "Doing Git clone, please enter your password if prompted...\n"
71
72
  system "git clone #{git_repository} #{app_path}"
72
73
  FileUtils.mkpath app_path unless File.exists? app_path
73
74
  Dir.chdir app_path do
@@ -61,6 +61,7 @@ class RailsPwnage::App::Svn
61
61
  app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
62
62
  return :next unless remote_path =~ /svn.*\:\/\//
63
63
 
64
+ print "Doing SVN checkout, please enter your password if prompted...\n"
64
65
  system "svn co #{remote_path} #{app_path}"
65
66
 
66
67
  # check that we really checked out a Rails app
@@ -77,10 +77,14 @@ class RailsPwnage::Executor
77
77
  app_name = args[1]
78
78
  instance_name = args[2] || '.'
79
79
  RailsPwnage::App.manage app_name, instance_name, :checkpoint
80
- when 'restore', 'reload', 'recover', 'rollback'
80
+ when 'restore', 'rollback'
81
81
  app_name = args[1]
82
82
  instance_name = args[2] || '.'
83
83
  RailsPwnage::App.manage app_name, instance_name, :rollback
84
+ when 'restoredb', 'rollbackdb', 'restore_db', 'rollback_db'
85
+ app_name = args[1]
86
+ instance_name = args[2] || '.'
87
+ RailsPwnage::App.manage app_name, instance_name, :rollback_db
84
88
  when 'console'
85
89
  app_name = args[1]
86
90
  instance_name = args[2] || '.'
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rails_pwnerer}
5
- s.version = "0.6.38"
5
+ s.version = "0.6.39"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2009-03-27}
9
+ s.date = %q{2009-03-28}
10
10
  s.default_executable = %q{bin/rpwn}
11
11
  s.description = %q{Rails deployment tool/hack.}
12
12
  s.email = %q{victor@costan.us}
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.6.38
4
+ version: 0.6.39
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: 2009-03-27 00:00:00 -04:00
12
+ date: 2009-03-28 00:00:00 -04:00
13
13
  default_executable: bin/rpwn
14
14
  dependencies: []
15
15