This file contains 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 characters
namespace :aws do | |
task :set_bucket_objects_permission do | |
AWS.config(access_key_id: ENV['AWS_ACCESS_KEY_ID'], secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], region: 'ap-southeast-1', :s3 => { :region => 'ap-southeast-1' }) | |
bucket = AWS::S3.new.buckets[ENV['S3_BUCKET_NAME']] | |
if bucket.exists? | |
bucket.objects.each do |object| | |
puts object.key | |
object.acl = :public_read |
This file contains 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 characters
# subdomains.rake in /lib/tasks | |
namespace :subdomains do | |
desc "adds the necessary hosts to your /etc/hosts file from current subdomains in your application" | |
task :setup => :environment do | |
# NOTE: default_hosts is used as a locator for the line to update in /etc/hosts | |
tmp_file, changed = '/tmp/etc_hosts_copy', false | |
default_hosts, hosts = %w(blog.local emptyblog.blog.local), [] | |
# find all the subdomains used in your app (push to hosts array) - modify this to suit your app |