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 +2 -0
- data/lib/pwnage/app/main.rb +3 -0
- data/lib/pwnage/app/vcs/git.rb +11 -1
- data/lib/pwnage/app/vcs/perforce.rb +11 -2
- data/lib/pwnage/app/vcs/svn.rb +7 -0
- data/rails_pwnerer.gemspec +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/pwnage/app/main.rb
CHANGED
@@ -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
|
data/lib/pwnage/app/vcs/git.rb
CHANGED
@@ -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
|
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(
|
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 "
|
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'))
|
data/lib/pwnage/app/vcs/svn.rb
CHANGED
@@ -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
|
data/rails_pwnerer.gemspec
CHANGED