I've been using asset_sync
, to move our static assets to Amazon S3, and I've noticed that when I precompile my assets (using foreman run rake assets:precompile
), the base directories get flattened. They go from:
/app
/assets/
/images
image.png
image2.png
/subdir
image3.png
/javascripts
script.js
/stylesheets
style.css
To:
/public
/assets/
image.png
image2.png
/subdir
image3.png
script.js
style.css
It keeps any subdirectories, but the base directories get removed for some reason.
Is it possible to disable this? I'd like to keep my S3 assets organized into directories. I could probably resolve this by adding additional directories so that the structure is the following.
/app
/assets/
/images
/images
image.png
image2.png
/subdir
image3.png
/javascripts
/javascripts
script.js
/stylesheets
/stylesheets
style.css
But that just seems like a dirty solution.
I'm configuring my assets for precompiling with:
Rails.application.config.assets.precompile = []
Rails.application.config.assets.precompile += ['application.js']
Rails.application.config.assets.precompile += Loader.js_files
Rails.application.config.assets.precompile += ['*.css', '*.png', '*.svg', '*.jpg']
My environment has the following variables":
ASSET_SYNC_GZIP_COMPRESSION=true
ASSET_SYNC_MANIFEST=true
ASSET_SYNC_EXISTING_REMOTE_FILES=keep
AWS_ACCESS_KEY_ID=xxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxx
FOG_DIRECTORY=aws-example
FOG_PREFIX=/assets/
FOG_PROVIDER=AWS
FOG_REGION=us-west-1