How to deploy Rails 4 with Capistrano 2 and precompile assets locally -


recently upgraded application rails 3 rails 4. in deploy scripts precompile assets locally , rsync them server(s). in rails 4 asset pipeline produces manifest- < random > .json instead of manifest.yml. since manifest files named differently, adds multiple manifest.json files shared assets directory. application picks wrong manifest file, , serves old assets.

i have read various issues related in github pull request threads:

my options seem be:

  1. don't share asset directory.

    this break old clients asking old resources.

  2. switch compiling assets on servers.

    this add complexity server.

  3. move manifest file outside of shared asset directory.

    i have since learned option removed in rails 4.

are there other solutions problem?

i found best answer after looking @ standard capistrano rails asset precompile task. added command local precompile task moves old asset manifest current release asset_manifest.json. leaves 1 manifest when new 1 uploaded.

run "mv -- #{shared_manifest_path.shellescape} #{current_path.to_s.shellescape}/assets_manifest#{file.extname(shared_manifest_path)}".compact

moving manifest-.json current_dir asset_manifest.json allows capistrano restore correct manifest file on rollback.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -