From: Aaron Hill Date: Sun, 9 Mar 2014 16:47:23 +0000 (-0400) Subject: Upload HTTP record to S3 after a successful test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=34fa0a40a6bfc9c5445702e00ada2f8f8363f712;p=tweepy.git Upload HTTP record to S3 after a successful test --- diff --git a/.travis.yml b/.travis.yml index 3d68d78..b3d3b32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ env: nKkytraqLGUm33K1GpwkjOyxACDHYw4GMvOGyDwVTX7VNwqxbkUojB7qXYoQ JjlEyFWS487IFteR87U9pt18qongJJIphaBdT9/lDVLsMWZ0Jh5ZLQfX+2jS aF2UwsrYkzBUMrqMqYCc2+X6CuswLEZTVXDAlNh+emvhxZ5faMI= -after_success: if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then coveralls; fi +after_success: if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then coveralls; python upload_record.py; fi deploy: provider: pypi user: jroesslein diff --git a/test_requirements.txt b/test_requirements.txt index e52ad2a..912d5e6 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -2,3 +2,4 @@ httreplay==0.1.4 coveralls==0.2 unittest2==0.5.1 mock==1.0.1 +boto==2.27 diff --git a/upload_record.py b/upload_record.py new file mode 100644 index 0000000..2e64188 --- /dev/null +++ b/upload_record.py @@ -0,0 +1,10 @@ +import boto +from boto.s3.key import Key +from os import environ as env + +conn = boto.connect_s3() +bucket = conn.get_bucket(env['AWS_BUCKET']) +k = bucket.get_key('record', validate=False) +k.set_contents_from_filename('tests/record.json') +k.set_acl('public-read') +k.close(fast=True)