aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/install
blob: c9d0aef7865caf8522911128f07090c34ad9011e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python

import os
import sys
import tarfile
import urllib
from utils import get_bundle_filename

wanted_filename = get_bundle_filename()

url = 'https://fixmystreet-bundle-cache.s3.amazonaws.com/%s' % wanted_filename
try:
    urllib.urlretrieve(url, wanted_filename)
    if tarfile.is_tarfile(wanted_filename):
        tfile = tarfile.open(wanted_filename)
        tfile.extractall()
        print "Cached copy found and extracted"
        sys.exit(0)
    else:
        os.remove(wanted_filename)
except IOError:
    os.remove(wanted_filename)

print "No cached copy found, running carton install..."
ret = os.system('vendor/bin/carton install --deployment')
if ret:
    os.system('cat ~/.cpanm/build.log')

sys.exit(ret)