diff --git a/config/deploy.rb b/config/deploy.rb index 74cd246a..1f5c286a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -35,10 +35,16 @@ append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/uplo # Ruby version / RVM set :rvm1_ruby_version, '2.3.3@retrospring' +require 'pry' +binding.pry + # Rollbar set :rollbar_token, '35f65946f562414da66d0d48073f5290' # TODO: before publishing this repo (again) remove this token set :rollbar_env, Proc.new { fetch :stage } 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 after 'deploy:cleanup', 'deploy:restart' diff --git a/lib/capistrano/tasks/i18n.rake b/lib/capistrano/tasks/i18n.rake new file mode 100644 index 00000000..e47eb768 --- /dev/null +++ b/lib/capistrano/tasks/i18n.rake @@ -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