diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .travis.yml | 5 | ||||
-rwxr-xr-x | .travis/after_script | 8 | ||||
-rwxr-xr-x | .travis/install | 7 | ||||
-rwxr-xr-x | .travis/utils.py | 22 |
5 files changed, 31 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore index 5c77b4b80..ca3180604 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ Makefile blib/ inc/ _Inline/ +*.pyc # International /fixmystreet-international diff --git a/.travis.yml b/.travis.yml index c0191f177..6a2085785 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,10 @@ notifications: language: perl perl: - - "5.14" + - "5.14" # wheezy, precise + - "5.18" # trusty + - "5.20" # jessie, vivid, wily + - "5.22" # stretch, xenial env: global: diff --git a/.travis/after_script b/.travis/after_script index 006ff7849..2a8b2268d 100755 --- a/.travis/after_script +++ b/.travis/after_script @@ -1,16 +1,12 @@ #!/usr/bin/env python -import hashlib import os import site -import subprocess import sys import tarfile +from utils import get_bundle_filename -root = os.path.join(os.path.dirname(__file__), '..') -with open(os.path.join(root, 'cpanfile.snapshot')) as cpanfile: - hash = hashlib.md5(cpanfile.read()).hexdigest() -wanted_filename = 'fixmystreet-local-%s.tgz' % hash +wanted_filename = get_bundle_filename() if os.path.exists(wanted_filename) and os.path.getsize(wanted_filename): print "File was downloaded, no need to upload" diff --git a/.travis/install b/.travis/install index 00ef16bc8..c9d0aef78 100755 --- a/.travis/install +++ b/.travis/install @@ -1,15 +1,12 @@ #!/usr/bin/env python -import hashlib import os import sys import tarfile import urllib +from utils import get_bundle_filename -root = os.path.join(os.path.dirname(__file__), '..') -with open(os.path.join(root, 'cpanfile.snapshot')) as cpanfile: - hash = hashlib.md5(cpanfile.read()).hexdigest() -wanted_filename = 'fixmystreet-local-%s.tgz' % hash +wanted_filename = get_bundle_filename() url = 'https://fixmystreet-bundle-cache.s3.amazonaws.com/%s' % wanted_filename try: diff --git a/.travis/utils.py b/.travis/utils.py new file mode 100755 index 000000000..f56b7d9d4 --- /dev/null +++ b/.travis/utils.py @@ -0,0 +1,22 @@ +import hashlib +import os + + +def get_bundle_filename(): + root = os.path.join(os.path.dirname(__file__), '..') + with open(os.path.join(root, 'cpanfile.snapshot')) as cpanfile: + hash = hashlib.md5(cpanfile.read()).hexdigest() + + try: + version = os.environ['TRAVIS_PERL_VERSION'] + except KeyError: + # Not running on Travis, assume default Travis version + version = '5.14' + + if version == '5.14': + version = '' + else: + version = '-%s' % version + + filename = 'fixmystreet-local-%s%s.tgz' % (hash, version) + return filename |