rails_pwnerer 0.6.43 → 0.6.44

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/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.6.44. Git-based updates fetch repository changes before bringing app down.
2
+
1
3
  v0.6.43. Improved nginx settings for passing client IP through proxy.
2
4
 
3
5
  v0.6.42. Support for multiple DNS names.
@@ -45,6 +45,9 @@ module RailsPwnage::App
45
45
  # updates an application (restart servers if necessary)
46
46
  def self.update(app_name, instance_name)
47
47
  instance_magic(app_name, instance_name) do |app, instance|
48
+ [Git, Perforce, Svn].each do |mod|
49
+ mod.new.update_prefetch app, instance
50
+ end
48
51
  update_app app, instance do
49
52
  [Git, Perforce, Svn, Config, Gems, Database, Scripts].each do |mod|
50
53
  mod.new.update app, instance
@@ -44,13 +44,23 @@ class RailsPwnage::App::Git
44
44
  def update(app_name, instance_name)
45
45
  app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
46
46
  return unless File.exists?(File.join(app_path, '.git'))
47
- # TODO: maybe backup old version before issuing the svn update?
47
+ # TODO: maybe backup old version before issuing the git update?
48
48
 
49
49
  cleanup_app_caches app_name, instance_name
50
50
  revert_config_changes app_name, instance_name
51
51
  git_update app_name, instance_name
52
52
  end
53
53
 
54
+ def update_prefetch(app_name, instance_name)
55
+ app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
56
+ return unless File.exists?(File.join(app_path, '.git'))
57
+
58
+ Dir.chdir app_path do
59
+ print "Doing Git fetch, please enter your password if prompted...\n"
60
+ Kernel.system 'git fetch origin'
61
+ end
62
+ end
63
+
54
64
  def cleanup
55
65
  # git checkout -- paths
56
66
  end
@@ -64,7 +64,9 @@ class RailsPwnage::App::Perforce
64
64
  p4_config = File.read perforce_config_file
65
65
  return false if p4_config.index "P4PASSWD="
66
66
 
67
- p4_password = prompt_user_for_password('Please enter your Perforce password:', 'Cannot securely obtain your Perforce password')
67
+ p4_password = prompt_user_for_password(
68
+ 'Please enter your Perforce password:',
69
+ 'Cannot securely obtain your Perforce password')
68
70
  return false unless p4_password
69
71
  ENV['P4PASSWD'] = p4_password
70
72
  return true
@@ -124,7 +126,7 @@ View:
124
126
  END_SETTINGS
125
127
  end
126
128
 
127
- print "Creaing Perforce client...\n"
129
+ print "Creating Perforce client...\n"
128
130
  Dir.chdir RailsPwnage::Config[app_name, instance_name][:app_path] do
129
131
  success = Kernel.system "p4 client -i < .p4clientspec"
130
132
  if !success
@@ -149,6 +151,13 @@ END_SETTINGS
149
151
  cleanup_app_caches app_name, instance_name
150
152
  end
151
153
 
154
+ def update_prefetch(app_name, instance_name)
155
+ app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
156
+ return unless File.exists?(File.join(app_path, '.p4clientspec'))
157
+
158
+ # TODO: maybe figure out a way to prefetch Perforce, if it's ever worth it
159
+ end
160
+
152
161
  def remove(app_name, instance_name)
153
162
  app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
154
163
  return unless File.exists?(File.join(app_path, '.p4clientspec'))
@@ -78,4 +78,11 @@ class RailsPwnage::App::Svn
78
78
  revert_config_changes app_name, instance_name
79
79
  svn_update app_name, instance_name
80
80
  end
81
+
82
+ def update_prefetch(app_name, instance_name)
83
+ app_path = RailsPwnage::Config[app_name, instance_name][:app_path]
84
+ return unless File.exists?(File.join(app_path, '.svn'))
85
+
86
+ # TODO: figure out a way to prefetch using SVN (hidden local repo mirror?)
87
+ end
81
88
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rails_pwnerer}
5
- s.version = "0.6.43"
5
+ s.version = "0.6.44"
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"]
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.43
4
+ version: 0.6.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan