capobvious 0.2.92 → 0.2.93
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capistrano/ext/capobvious.rb +30 -16
- data/lib/capobvious/version.rb +1 -1
- metadata +1 -1
@@ -80,15 +80,15 @@ Capistrano::Configuration.instance.load do
|
|
80
80
|
after 'deploy:update_code', 'assets:precompile'
|
81
81
|
before 'deploy:finalize_update', 'assets:symlink'
|
82
82
|
end
|
83
|
-
|
83
|
+
after "deploy:update_code", "auto:run"
|
84
84
|
|
85
85
|
namespace :assets do
|
86
86
|
desc "Local Assets precompile"
|
87
87
|
task :local_precompile do
|
88
88
|
system("bundle exec rake assets:precompile && cd public && tar czf assets.tar.gz assets/")
|
89
|
-
upload("public/assets.tar.gz","#{
|
89
|
+
upload("public/assets.tar.gz","#{latest_release}/public/assets.tar.gz")
|
90
90
|
system("rm public/assets.tar.gz && rm -rf tmp/assets && mv public/assets tmp/assets")
|
91
|
-
run("cd #{
|
91
|
+
run("cd #{latest_release}/public && rm -rf assets/ && tar xzf assets.tar.gz && rm assets.tar.gz")
|
92
92
|
end
|
93
93
|
desc "Assets precompile"
|
94
94
|
task :precompile, :roles => :web, :except => { :no_release => true } do
|
@@ -107,23 +107,23 @@ Capistrano::Configuration.instance.load do
|
|
107
107
|
namespace :delayed_job do
|
108
108
|
desc 'Start the delayed_job process'
|
109
109
|
task :start, :roles => :app do
|
110
|
-
run "cd #{
|
110
|
+
run "cd #{latest_release} && RAILS_ENV=#{rails_env} script/delayed_job start"
|
111
111
|
end
|
112
112
|
desc "Restart the delayed_job process"
|
113
113
|
task :restart, :roles => :app do
|
114
114
|
logger.important 'Restarting delayed_job process'
|
115
|
-
run "cd #{
|
115
|
+
run "cd #{latest_release}; RAILS_ENV=#{rails_env} script/delayed_job restart"
|
116
116
|
end
|
117
117
|
desc 'Stop the delayed_job process'
|
118
118
|
task :stop, :roles => :app do
|
119
|
-
run "cd #{
|
119
|
+
run "cd #{latest_release} && RAILS_ENV=#{rails_env} script/delayed_job stop"
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
123
|
namespace :sitemap_generator do
|
124
124
|
desc 'Start rack refresh sitemap project'
|
125
125
|
task :refresh do
|
126
|
-
run "cd #{
|
126
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} sitemap:refresh"
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
@@ -134,7 +134,7 @@ Capistrano::Configuration.instance.load do
|
|
134
134
|
end
|
135
135
|
desc "Create .rvmrc & files"
|
136
136
|
task :rvmrc do
|
137
|
-
put rvmrc, "#{
|
137
|
+
put rvmrc, "#{latest_release}/.rvmrc"
|
138
138
|
end
|
139
139
|
task :dbconf do
|
140
140
|
serv_path = (exists?(:dbconf) && fetch(:dbconf)) || "#{database_yml_path}.server"
|
@@ -171,12 +171,26 @@ Capistrano::Configuration.instance.load do
|
|
171
171
|
if exists?(:delayed_job) && fetch(:delayed_job) == true
|
172
172
|
delayed_job.restart
|
173
173
|
end
|
174
|
+
|
175
|
+
|
174
176
|
end
|
175
177
|
task :prepare do
|
176
178
|
db.create
|
177
179
|
nginx.conf
|
178
180
|
install.p7zip
|
179
181
|
end
|
182
|
+
|
183
|
+
|
184
|
+
task :runtask do
|
185
|
+
path = "#{latest_release}/script/autorun.task"
|
186
|
+
if remote_file_exists?(path)
|
187
|
+
logger.important "Launching autorun commands"
|
188
|
+
cmds = capture("cat #{path}").split("\n").map(&:strip).map{|cmd| "RAILS_ENV=#{rails_env} #{cmd}" }
|
189
|
+
puts "cd #{latest_release} && #{cmds.join(' && ')}"
|
190
|
+
else
|
191
|
+
logger.important "autorun script not found"
|
192
|
+
end
|
193
|
+
end
|
180
194
|
end
|
181
195
|
|
182
196
|
|
@@ -191,17 +205,17 @@ Capistrano::Configuration.instance.load do
|
|
191
205
|
end
|
192
206
|
end
|
193
207
|
task :seed do
|
194
|
-
run "cd #{
|
208
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} db:seed"
|
195
209
|
end
|
196
210
|
task :reset do
|
197
|
-
run "cd #{
|
211
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} db:reset"
|
198
212
|
end
|
199
213
|
task :hard_reset do
|
200
|
-
run "cd #{
|
214
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} db:migrate VERSION=0 && bundle exec rake RAILS_ENV=#{rails_env} db:migrate && bundle exec rake RAILS_ENV=#{rails_env} db:seed"
|
201
215
|
end
|
202
216
|
|
203
217
|
task :migrate do
|
204
|
-
run "cd #{
|
218
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} db:migrate"
|
205
219
|
end
|
206
220
|
task :import do
|
207
221
|
file_name = "#{db_file_name}.#{db_archive_ext}"
|
@@ -462,19 +476,19 @@ Capistrano::Configuration.instance.load do
|
|
462
476
|
namespace :sphinx do
|
463
477
|
desc "Rebuild indexes"
|
464
478
|
task :rebuild, :roles => :app, :except => {:no_release => true} do
|
465
|
-
run "cd #{
|
479
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} ts:rebuild"
|
466
480
|
end
|
467
481
|
desc "Sphinx start"
|
468
482
|
task :start, :roles => :app, :except => {:no_release => true} do
|
469
|
-
run "cd #{
|
483
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} ts:start"
|
470
484
|
end
|
471
485
|
desc "Sphinx stop"
|
472
486
|
task :stop, :roles => :app, :except => {:no_release => true} do
|
473
|
-
run "cd #{
|
487
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} ts:stop"
|
474
488
|
end
|
475
489
|
desc "Sphinx configure"
|
476
490
|
task :stop, :roles => :app, :except => {:no_release => true} do
|
477
|
-
run "cd #{
|
491
|
+
run "cd #{latest_release} && bundle exec rake RAILS_ENV=#{rails_env} ts:conf"
|
478
492
|
end
|
479
493
|
desc "Re-establish symlinks"
|
480
494
|
task :symlink do
|
data/lib/capobvious/version.rb
CHANGED