Upload HTTP record to S3 after a successful test
authorAaron Hill <aa1ronham@gmail.com>
Sun, 9 Mar 2014 16:47:23 +0000 (12:47 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Sun, 9 Mar 2014 16:47:55 +0000 (12:47 -0400)
.travis.yml
test_requirements.txt
upload_record.py [new file with mode: 0644]

index 3d68d78d3779b74cde64ce0c72470719ec10c70b..b3d3b32519ea10b546f312dfad31a65f52465bc8 100644 (file)
@@ -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
index e52ad2ae7784842211ceadac8834e9ddd67cf624..912d5e6ba89916d67dfa1fc3acaf1be07794016d 100644 (file)
@@ -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 (file)
index 0000000..2e64188
--- /dev/null
@@ -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)