aboutsummaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/after_script8
-rwxr-xr-x.travis/install7
-rwxr-xr-x.travis/utils.py22
3 files changed, 26 insertions, 11 deletions
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