Deploy updates
This commit is contained in:
+36
-6
@@ -1,6 +1,6 @@
|
||||
# config valid only for Capistrano 3.1
|
||||
# lock '3.2.1'
|
||||
require 'capistrano/local_precompile'
|
||||
#require 'capistrano/local_precompile'
|
||||
|
||||
set :application, 'mozo.bar'
|
||||
#set :repo_url, 'root@uflows.com:/var/git/qwaiter.git'
|
||||
@@ -60,12 +60,12 @@ namespace :deploy do
|
||||
# Your restart mechanism here, for example:
|
||||
within release_path do
|
||||
#execute :rake, 'cache:clear', as: 'www-data'
|
||||
with rails_env: fetch(:rails_env) do
|
||||
execute :rake, 'dedigest_assets', as: 'www-data'
|
||||
end
|
||||
#with rails_env: fetch(:rails_env) do
|
||||
#execute :rake, 'dedigest_assets', as: 'www-data'
|
||||
#end
|
||||
end
|
||||
execute :chown, "-R www-data:www-data", release_path
|
||||
execute :chown, "-R www-data:www-data", release_path.join('public/assets/')
|
||||
#execute :chown, "-R www-data:www-data", release_path
|
||||
#execute :chown, "-R www-data:www-data", release_path.join('public/assets/')
|
||||
#execute :kill, capture("lsof -i:9022 -t") # kill counters, will reboot itself
|
||||
execute :touch, release_path.join('tmp/restart.txt')
|
||||
end
|
||||
@@ -83,6 +83,36 @@ namespace :deploy do
|
||||
|
||||
end
|
||||
|
||||
namespace :assets do
|
||||
|
||||
Rake::Task['deploy:assets:precompile'].clear_actions
|
||||
Rake::Task['deploy:assets:backup_manifest'].clear_actions
|
||||
|
||||
desc 'Precompile assets locally and upload to servers'
|
||||
task :precompile do
|
||||
on roles(fetch(:assets_roles)) do
|
||||
run_locally do
|
||||
with rails_env: fetch(:rails_env) do
|
||||
#execute 'bin/rake assets:precompile'
|
||||
#execute 'bin/rake dedigest_assets'
|
||||
end
|
||||
end
|
||||
|
||||
#within release_path do
|
||||
#with rails_env: fetch(:rails_env) do
|
||||
#upload!('./public/assets/', "#{shared_path}/public/", recursive: true)
|
||||
#end
|
||||
#end
|
||||
rsync_host = host
|
||||
run_locally { execute "rsync -av --delete ./public/assets/ #{fetch(:user)}@#{rsync_host}:#{shared_path}/public/assets/" }
|
||||
execute :chown, "-R www-data:www-data", shared_path.join('public/assets/')
|
||||
|
||||
#run_locally { execute 'rm -rf public/assets' }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
after :publishing, :restart do
|
||||
#deploy.update_remote_cache
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user