@@ -0,0 +1,1254 @@
+# To use this script you must have the following environment variables set:%0A#   AWS_ACCESS_KEY_ID%0A#   AWS_SECRET_ACCESS_KEY%0A# as explained in: http://boto.s3.amazonaws.com/s3_tut.html%0A%0Aimport os%0Afrom boto import connect_s3%0Afrom boto.s3.key import Key%0Afrom fabric.api import abort%0Afrom fabric.contrib.console import confirm%0A%0Abucket_name = 'www.ec2instances.info'%0A%0Adef create_bucket():%0A    conn = connect_s3()%0A    bucket = conn.create_bucket(bucket_name, policy='public-read')%0A    bucket.configure_website('index.html', 'error.html')%0A%0Adef deploy(dir='www'):%0A    conn = connect_s3()%0A    bucket = conn.get_bucket(bucket_name)%0A%0A    for root, dirs, files in os.walk(dir):%0A        for name in files:%0A            filename = os.path.join(root, name)%0A            print 'Uploading %25s' %25 filename%0A            k = Key(bucket)%0A            k.key = name%0A            headers = %7B%7D%0A            k.set_contents_from_filename(filename, headers=headers,%0A                                         policy='public-read')%0A%0Adef delete():%0A    if not confirm(%22Are you sure you want to delete the bucket %25r?%22%0A            %25 bucket_name):%0A        abort('Aborting at user request.')%0A    conn = connect_s3()%0A    conn.delete_bucket(bucket_name)%0A    print 'Bucket %25r deleted.' %25 bucket_name%0A%0A

Add deploy script