diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-02-05 16:59:28 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-02-05 18:12:48 +0000 |
commit | 1cf8f514a231924cd992a5ca4f6af692c365da4a (patch) | |
tree | 6b098c67f8996427d10d8b892bf04fcd0c8f7684 /.travis/after_script | |
parent | 46541a64e9ca47d235f4fd832024bfcfa61db673 (diff) |
[Travis] Only install boto when necessary.
And make sure file is removed if not a tar file.
Diffstat (limited to '.travis/after_script')
-rwxr-xr-x | .travis/after_script | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/.travis/after_script b/.travis/after_script index 37fd37eb8..006ff7849 100755 --- a/.travis/after_script +++ b/.travis/after_script @@ -2,13 +2,11 @@ import hashlib import os +import site import subprocess import sys import tarfile -import boto -from boto.s3.key import Key - root = os.path.join(os.path.dirname(__file__), '..') with open(os.path.join(root, 'cpanfile.snapshot')) as cpanfile: hash = hashlib.md5(cpanfile.read()).hexdigest() @@ -18,6 +16,12 @@ if os.path.exists(wanted_filename) and os.path.getsize(wanted_filename): print "File was downloaded, no need to upload" sys.exit() +site.addsitedir(site.getusersitepackages()) +os.system('pip install --user boto') + +import boto +from boto.s3.key import Key + print "Creating archive..." tfile = tarfile.open(wanted_filename, 'w:gz') tfile.add('local') |