deploy_revision with asset pipeline compilation

Ohai Chefs!

I’ve a situation with my rails app deployment.

This assets:precompile hook is taking a LONG TIME, almost 5mins just waiting, though the assets were not modified.

deploy_revision app[‘id’] do

before_restart do
# release_path is the path to the timestamp dir for the current release
current_release = release_path
# Create a local variable for the node so we’ll have access to the attributes
deploy_node = node
# A local variable with the deploy resource.
deploy_resource = new_resource “---- Release path is: #{current_release} ----” "*" * 20 + "COMPILING ASSETS" + "*" * 20
execute "asset_precompile" do
  cwd release_path
  user app['owner']
  group app['group']
  command "bundle exec rake assets:precompile --trace"
  environment ({'RAILS_ENV' => rails_env})


There are gists available for capistrano recipe.
What I want is to add somekind of check and if repo is updated, do the compilation.
If not then just move/copy the earlier compiled assets without breaking the asset pipeline.

~ Sachin Sagar Rai
Ruby on Rails Developer (
Sent with Sparrow (