Created
November 3, 2011 18:38
-
-
Save ckdake/1337372 to your computer and use it in GitHub Desktop.
Revisions
-
ckdake revised this gist
Nov 3, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ config.fog_credentials = { provider: 'AWS', aws_access_key_id: ENV['AWS_ACCESS_KEY'], aws_secret_access_key: ENV['AWS_ACCESS_SECRET'], region: 'us-east-1' } config.fog_host = "//#{ENV['MEDIA_BUCKET']}.s3.amazonaws.com" -
ckdake created this gist
Nov 3, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ gem 'fog' # Storage on S3 for carrierwave gem 'rmagick' # Resizes images and makes thumbnails gem 'carrierwave' # Image attachments, newer version doesn't work with local files preview hack gem 'asset_sync' # Syncs assets to S3 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ if Rails.env.production? CarrierWave.configure do |config| config.fog_credentials = { provider: 'AWS', aws_access_key_id: ENV['AWS_ACCESS_KEY'], aws_secret_access_key: ENV['AWS_ACCESS_SECRET', region: 'us-east-1' } config.fog_host = "//#{ENV['MEDIA_BUCKET']}.s3.amazonaws.com" config.fog_directory = ENV['MEDIA_BUCKET'] config.fog_attributes = {'Cache-Control' => 'max-age=315576000'} config.storage = :fog end elsif Rails.env.development? CarrierWave.configure do |config| config.storage = :file config.enable_processing = false end elsif Rails.env.test? or Rails.env.cucumber? CarrierWave.configure do |config| config.storage = :file config.enable_processing = false end end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ ENV['AWS_ACCESS_KEY'] = 'XXX' ENV['AWS_ACCESS_SECRET'] = 'XXXXXX' ENV['AWS_BUCKET'] = 'bucket-example-com' desc "deploys to heroku after uploading assets to S3" task deploy: [:environment, 'assets:precompile'] do puts `git push heroku` puts `rake assets:clean` end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ config.action_controller.asset_host = "//#{ENV['AWS_BUCKET']}.s3.amazonaws.com"