Optional execution on precompile #122

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
10 participants
Contributor

freerobby commented Nov 1, 2012

We love asset_sync, but we don't like that it bundles itself into the assets:precompile task. Our deploy system is such that this task can be run on multiple machines simultaneously, and we only want one box to upload its results.

I've created an assets:sync rake task which performs synchronization, and added a run_on_precompile configuration setting which, if true (default is true), will run that rake task after the assets:precompile rake task.

The default behavior remains exactly the same, but this provides a way for people to disable the automatic assets:precompile rake enhancement.

minimul commented Jan 7, 2013

+1

@turadg turadg commented on the diff Jan 10, 2013

spec/aws_with_yml/config/asset_sync.yml
@@ -3,6 +3,7 @@ defaults: &defaults
aws_access_key_id: "xxxx"
aws_secret_access_key: "zzzz"
region: "eu-west-1"
+ run_on_precompile: false
@turadg

turadg Jan 10, 2013

Contributor

This option makes sense, but shouldn't it default to running on precompile, as existing users expect?

@freerobby

freerobby Jan 10, 2013

Contributor

@turadg It does default to running on precompile; if that run_on_precompile: false line is not present, it will run. I added it to this spec yaml file to test that it does not run when disabled. See lib/asset_sync/config.rb, line 54 for the default setting.

@turadg

turadg Jan 10, 2013

Contributor

Whoops, sorry I didn't notice this asset_sync.yml was part of a test.

👍

ggilder commented Jan 18, 2013

👍

👍 yes please

+1

Please merge this! This is necessary for applications which deploy to multiple application servers.

tienle commented Apr 11, 2013

👍

Contributor

davidjrice commented Apr 25, 2013

Merged!

davidjrice closed this Apr 25, 2013

Contributor

freerobby commented Apr 25, 2013

@davidjrice woot! thanks.

Likewise! This has been really useful in production for us.

Thanks! Love this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment