Giter VIP home page Giter VIP logo

capistrano-faster-assets's People

Contributors

kenjiszk avatar martinsabo avatar noahsw avatar rhomeister avatar rso avatar shaicoleman avatar smyzert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

capistrano-faster-assets's Issues

Precompiling assets locally

Hi,

I've been using a custom script to precompile assets locally and just now switched to using this gem. This gem works great, but wouldn't it be faster and reduce server load to precompile the assets locally (if needed) and copy them over to server?

Here's the link to the capistrano task that I was using before:
https://github.com/TalkingQuickly/capistrano-3-rails-template/blob/master/lib/capistrano/tasks/compile_assets_locally.cap

It didn't check if compilation is required, but I think these two ideas/scripts can be merged.

assets_manifest_backup: No such file or directory

Whenever I peform a deploy, I get this error and all assets are precompiled, even if no changes to Gemfile or any of the assets:

INFO[435343cb] Running /usr/bin/env ls /home/deploy/project/releases/20141127132806/assets_manifest_backup on ip
DEBUG[435343cb] Command: cd /home/deploy/project/releases/20141127132806 && ( RAILS_ENV=production /usr/bin/env ls /home/deploy/project/releases/20141127132806/assets_manifest_backup )
DEBUG[435343cb]     ls: cannot access /home/deploy/project/releases/20141127132806/assets_manifest_backup
DEBUG[435343cb]     : No such file or directory
INFO[8c33627a] Running ~/.rvm/bin/rvm 2.1.4@project_rails32 do bundle exec rake assets:precompile on ip
DEBUG[8c33627a] Command: cd /home/deploy/project/releases/20141127132806 && ( RAILS_ENV=production ~/.rvm/bin/rvm 2.1.4@project_rails32 do bundle exec rake assets:precompile )

asset:precompile enhancements are not cleared

Rake Task Enhance is the standard way to add prerequisites to a rake task, in one of our projects we use it to enhance the asset precompilation as in the following example:

Rake::Task['assets:precompile'].enhance ['assets:write_error_pages']

Rake::Task['assets:precompile'].enhance do
  Rake::Task['assets:delete_error_pages'].invoke
end

So when clearing actions in this line (Rake::Task["deploy:assets:precompile"].clear_actions) only the actions are cleared but not the prerequisites I believe, because the enhancements are being executed before the asset precompilation even when the clear_actions is present.

The problem is that if those enhancements create some dynamic assets, those are being created before the evaluation of the diffs in the assets folders among both releases, hence both diffs will differ

The problem in the code above is that we need to create dynamic error pages into the asset folder , then precompile them, then delete the files from the assets folder. If the diff is calculated after the files are created, the diff will find differences.

Unconditional compilation

Humans are smarter than machines. At least now. Sometimes the developer needs to recompile all assets no matter what. It would be nice if this gem allowed that. Via an environment variable or something like that.

When using RVM, with a .rvmrc file, the backup manifest breaks.

Our server is using RVM, and we are using a .rvmrc (because it is still the best place to put export RAILS_ENV=staging that I have found). This obnoxious message comes up on a newly provisioned server, and breaks the deploy:assets:backup_manifest task.

Easy workaround: rvm rvmrc warning ignore all.rvmrcs

 INFO [224cd57f] Running /usr/bin/env cp You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

/web/railsapp/staging/releases/20150610202127/public/assets/.sprockets-manifest-fd7e2ccc959215614bf6fc35b33e3f3a.json /web/railsapp/staging/releases/20150610202127/assets_manifest_backup on stage.example.com
DEBUG [224cd57f] Command: cd /web/railsapp/staging/releases/20150610202127 && /usr/bin/env cp You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

/web/railsapp/staging/releases/20150610202127/public/assets/.sprockets-manifest-fd7e2ccc959215614bf6fc35b33e3f3a.json /web/railsapp/staging/releases/20150610202127/assets_manifest_backup
DEBUG [224cd57f]    You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
DEBUG [224cd57f]    you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
DEBUG [224cd57f]    or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
DEBUG [224cd57f]    '.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
DEBUG [224cd57f]    to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.
DEBUG [224cd57f]    
DEBUG [224cd57f]    cp: target ‘managers,\r’ is not a directory
DEBUG [224cd57f]    bash: line 1: you: command not found
DEBUG [224cd57f]    bash: line 2: or: command not found
DEBUG [224cd57f]    bash: line 3: .rvmrc: command not found
DEBUG [224cd57f]    bash: line 4: to: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Command::Failed: cp exit status: 126
cp stdout: Nothing written
cp stderr: Nothing written

Tasks: TOP => deploy:assets:backup_manifest
(See full trace by running task with --trace)
The deploy has failed with an error: cp exit status: 126
cp stdout: Nothing written
cp stderr: Nothing written

``` INFO [224cd57f] Running /usr/bin/env cp You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

/web/railsapp/staging/releases/20150610202127/public/assets/.sprockets-manifest-fd7e2ccc959215614bf6fc35b33e3f3a.json /web/railsapp/staging/releases/20150610202127/assets_manifest_backup on stage.example.com
DEBUG [224cd57f] Command: cd /web/railsapp/staging/releases/20150610202127 && /usr/bin/env cp You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

/web/railsapp/staging/releases/20150610202127/public/assets/.sprockets-manifest-fd7e2ccc959215614bf6fc35b33e3f3a.json /web/railsapp/staging/releases/20150610202127/assets_manifest_backup
DEBUG [224cd57f]    You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
DEBUG [224cd57f]    you can switch to '.ruby-version' using 'rvm rvmrc to ruby-version'
DEBUG [224cd57f]    or ignore this warning with 'rvm rvmrc warning ignore /web/railsapp/staging/.rvmrc',
DEBUG [224cd57f]    '.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
DEBUG [224cd57f]    to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.
DEBUG [224cd57f]    
DEBUG [224cd57f]    cp: target ‘managers,\r’ is not a directory
DEBUG [224cd57f]    bash: line 1: you: command not found
DEBUG [224cd57f]    bash: line 2: or: command not found
DEBUG [224cd57f]    bash: line 3: .rvmrc: command not found
DEBUG [224cd57f]    bash: line 4: to: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Command::Failed: cp exit status: 126
cp stdout: Nothing written
cp stderr: Nothing written

Tasks: TOP => deploy:assets:backup_manifest
(See full trace by running task with --trace)
The deploy has failed with an error: cp exit status: 126
cp stdout: Nothing written
cp stderr: Nothing written

Add support for Capistrano 3.0

Is there any way you can add a new branch/tag to support version 3.0.x.
This gem is a good help for people that have big deployment time, so it would be very nice to support users that don't have the luxury to update Capistrano on legacy (even if not very old) applications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.