Skip to content

Commit

Permalink
Merge branch 'release/0.2.1.1'
Browse files Browse the repository at this point in the history
* release/0.2.1.1:
  precompile locally
  • Loading branch information
kalashnikovisme committed May 20, 2015
2 parents 3632884 + 1b9b30a commit 0525f52
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Application < Rails::Application
config.i18n.available_locales = [:en, :ru]
config.i18n.default_locale = :ru
config.assets.enabled = true
config.assets.initialize_on_precompile = true
config.assets.initialize_on_precompile = false
config.assets.version = '1.0'
config.assets.paths << Rails.root.join("app", "assets", "fonts")
config.assets.paths << Rails.root.join("app", "assets", "*.ico")
Expand Down
23 changes: 23 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Rake::Task["deploy:compile_assets"].clear

desc "Precompile assets locally and then rsync to web servers"
task :compile_assets do
# compile assets locally
run_locally do
with rails_env: fetch(:stage) do
execute :bundle, "exec rake assets:precompile"
end
end

# rsync to each server
local_dir = "./public/assets/"
on roles(:web) do
# this needs to be done outside run_locally in order for host to exist
remote_dir = "#{host.user}@#{host.hostname}:#{shared_path}/public/assets/"

run_locally { execute "rsync -av --delete #{local_dir} #{remote_dir}" }
end

# clean up
run_locally { execute "rm -rf #{local_dir}" }
end
# config valid only for Capistrano 3.2.1
set :application, 'ulmicru'
set :repo_url, 'git@github.com:ulmic/ulmicru.git'
Expand Down

0 comments on commit 0525f52

Please sign in to comment.