Add Capistrano task to create i18n JS files

This commit is contained in:
Georg Gadinger 2017-03-31 22:33:07 +02:00
parent 28cc6b5938
commit dcca449de1
2 changed files with 15 additions and 0 deletions

View File

@ -35,10 +35,16 @@ append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/uplo
# Ruby version / RVM # Ruby version / RVM
set :rvm1_ruby_version, '2.3.3@retrospring' set :rvm1_ruby_version, '2.3.3@retrospring'
require 'pry'
binding.pry
# Rollbar # Rollbar
set :rollbar_token, '35f65946f562414da66d0d48073f5290' # TODO: before publishing this repo (again) remove this token set :rollbar_token, '35f65946f562414da66d0d48073f5290' # TODO: before publishing this repo (again) remove this token
set :rollbar_env, Proc.new { fetch :stage } set :rollbar_env, Proc.new { fetch :stage }
set :rollbar_role, Proc.new { :app } set :rollbar_role, Proc.new { :app }
# Create JS i18n files after precompiling assets
after 'assets:precompile', 'i18n:js_assets'
# Restart the app server after successful deploy # Restart the app server after successful deploy
after 'deploy:cleanup', 'deploy:restart' after 'deploy:cleanup', 'deploy:restart'

View File

@ -0,0 +1,9 @@
namespace :i18n do
task :js_assets do
within release_path do
with rails_env: fetch(:rails_env), rails_groups: fetch(:rails_assets_groups) do
execute :rake, "i18n:js:export"
end
end
end
end