Deploy A Pile of Stuff to S3
Because sometimes, you just want to shove a bunch of stuff onto S3
Deploying via a Script
deployer = S3Deployer.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
deployer.deploy("#{Dir.pwd}/directory_to_deploy", "amazon.bucket.name")
Deploying via the Command Line
Just cd
to the directory you want to deploy and run
s3deploy -b BUCKET_NAME
Deploying with multiple people
When working with multiple people who may be deploying code at the same time it's helpful to make sure that only one deployment happens at a time. Use with_lock for this.
deployer = S3Deployer.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
deployer.bucket_name = "amazon.bucket.name"
deployer.with_lock do |deployer|
deployer.deploy("#{Dir.pwd}/directory_to_deploy")
end