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?
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?
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.
you can use env variables to force asset pecompilations
mina deploy force_assets=true
Just a heads up that the right env variable is: force_asset_precompile=true
Most helpful comment
Just a heads up that the right env variable is:
force_asset_precompile=true