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

Asset precompilation when changes only occur in included gems #369

Closed
Epigene opened this issue Feb 4, 2016 · 4 comments
Closed

Asset precompilation when changes only occur in included gems #369

Epigene opened this issue Feb 4, 2016 · 4 comments

Comments

@Epigene
Copy link

Epigene commented Feb 4, 2016

It seems that mina does not detect asset changes and therefore skips precompilation when the changes have only occured in included gems (Rails engines).

So far we solve this oversight by forcing precompilation selectively with a check in deploy block

deploy do
  if hash.extras.include?("compile")
    invoke :'rails:assets_precompile:force'
  else
    invoke :'rails:assets_precompile'
  end
end

And running

mina deploy[compile]

Is there any configuration to be done to expose mina to asset changes in gems or is this a feature yet to be developed?

@flowerett
Copy link
Contributor

If I understand you right, you need to pass some settings to the deploy section.

but you always could do it in a regular way:

set :force_precompile, -> { true }

and use this setting later as you describe above, like:

deploy do
  if force_precompile
    invoke :'rails:assets_precompile:force'
  else
    invoke :'rails:assets_precompile'
  end
end

Does it makes sense?

@Epigene
Copy link
Author

Epigene commented Feb 6, 2016

Codewise - no. No need for the set directive, as hash.extras contains "compile".
Functionality-wise, yes. Normally we do standard mina deploy that does the "smart" precompile when asset changes are detected. Unfortunately it seems this detection does not work for assets in gems.

@d4be4st
Copy link
Member

d4be4st commented Jul 8, 2016

you can use env variables to force asset pecompilations

mina deploy force_assets=true

@d4be4st d4be4st closed this as completed Jul 8, 2016
@MarceloCajueiro
Copy link

Just a heads up that the right env variable is: force_asset_precompile=true

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

4 participants