capobvious 0.2.92 → 0.2.93

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- before "deploy:restart", "auto:run"
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","#{current_path}/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 #{current_path}/public && rm -rf assets/ && tar xzf assets.tar.gz && rm assets.tar.gz")
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 #{current_path} && RAILS_ENV=#{rails_env} script/delayed_job start"
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 #{current_path}; RAILS_ENV=#{rails_env} script/delayed_job restart"
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 #{current_path} && RAILS_ENV=#{rails_env} script/delayed_job stop"
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 #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake sitemap:refresh"
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, "#{current_path}/.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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} db:seed"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} db:reset"
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 #{current_path} && 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"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} db:migrate"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} ts:rebuild"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} ts:start"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} ts:stop"
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 #{current_path} && bundle exec rake RAILS_ENV=#{rails_env} ts:conf"
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
@@ -1,3 +1,3 @@
1
1
  module Capobvious
2
- VERSION = "0.2.92"
2
+ VERSION = "0.2.93"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capobvious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.92
4
+ version: 0.2.93
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: