Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to skip the asset precompile step for a single git push on Heroku?

Every time I deploy my Rails 3.2 project to Heroku, rake assets:precompile is run:

$ git push heroku master  
...
----> Preparing app for Rails asset pipeline
      Running: rake assets:precompile
      Asset precompilation completed (189.17s)
...

Sometimes I want to make a push that I know does not change any assets, such as a quick hotfix to a controller. Is it possible to skip the asset:precompile step for a single git push to Heroku?

Thanks.

like image 379
Eli Avatar asked Jul 22 '12 00:07

Eli


People also ask

How do I Precompile assets in Heroku?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.

What does rake assets Clean do?

The clean it removes the old versions of the precompiled assets while leaving the new assets in place. Show activity on this post. rake assets:clean removes compiled assets. It is run by cap deploy:assets:clean to remove compiled assets, generally from a remote server.


1 Answers

Sure! You'll need to create a manifest.yml in your_app/pubilc/assets directory.

The file can be blank. But ideally, you precompile everything locally, so deploys to Heroku would be much faster.

Make sure that you also committed the manifest.yml file when you're pushing to Heroku. Something like git add -f your_app/pubilc/assets/manifest.yml and a git push heroku master should suffice.

like image 145
Benjamin Tan Wei Hao Avatar answered Oct 04 '22 04:10

Benjamin Tan Wei Hao