From 34fa0a40a6bfc9c5445702e00ada2f8f8363f712 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 9 Mar 2014 12:47:23 -0400 Subject: [PATCH] Upload HTTP record to S3 after a successful test --- .travis.yml | 2 +- test_requirements.txt | 1 + upload_record.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 upload_record.py 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) -- 2.25.1