Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets compiling on redeploy #25

Closed
mrrooijen opened this issue Jun 28, 2012 · 4 comments
Closed

Assets compiling on redeploy #25

mrrooijen opened this issue Jun 28, 2012 · 4 comments
Assignees

Comments

@mrrooijen
Copy link

I tried to deploy the same codebase multiple times without commit changes but it seems it keeps recompiling the assets.

According to:

it should not re-compile if no changes took place.

@ghost ghost assigned rstacruz Jun 30, 2012
@rstacruz
Copy link
Member

rstacruz commented Jul 3, 2012

Can you check it manually? All that does is run a diff on those folders:

      diff -r "#{current_path}/vendor/assets/" "./vendor/assets/" 2>/dev/null
      diff -r "#{current_path}/app/assets/" "./app/assets/" 2>/dev/null

try running those commands manually and see what happens.

@be9
Copy link

be9 commented Jul 7, 2012

I have the same issue. Here's the resulting script piece (obtained with -S):

 ) && (

    # Check if the last deploy has assets built, and if it can be re-used.
    if [ -d "current/public/assets" ]; then
      count=`(
        diff -r "current/vendor/assets/" "./vendor/assets/" 2>/dev/null;
        diff -r "current/app/assets/" "./app/assets/" 2>/dev/null
      ) | wc -l`

      if [ "$((count))" = "0" ]; then
        echo "-----> Skipping asset precompilation"
        cp -R "current/public/assets" "./public/assets" &&
        exit
      fi
    fi

    echo "-----> Precompiling asset files"
    RAILS_ENV="production" bundle exec rake assets:precompile

  )

It seems that current_path is equal to "current" which is obviously wrong.

@mrrooijen
Copy link
Author

@rstacruz running those commands yields nothing. There is no output.

@rstacruz
Copy link
Member

Okay, gonna fix this up in a while. While I'm at it, I'll do the same optimization for db_migrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants