Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nthomas-mozilla/96914454d9308f8df93ee760d54d5f63 to your computer and use it in GitHub Desktop.
Save nthomas-mozilla/96914454d9308f8df93ee760d54d5f63 to your computer and use it in GitHub Desktop.
# detect problems
from boto.s3.connection import S3Connection
conn = S3Connection(anon=True)
bucket = conn.get_bucket('net-mozaws-prod-delivery-archive')
exclusions = [
r"^.*tests.*$",
r"^.*crashreporter.*$",
r"^.*[^k]\.zip(\.asc)?$",
r"^.*\.log$",
r"^.*\.txt$",
r"^.*/partner-repacks.*$",
r"^.*.checksums(\.asc)?$",
r"^.*/logs/.*$",
r"^.*/jsshell.*$",
r"^.*json$",
r"^.*/host.*$",
r"^.*/mar-tools/.*$",
r"^.*robocop.apk$",
r"^.*contrib.*",
r"^.*/beetmover-checksums/.*$",
]
def matches_exclude(keyname):
for exclude in exclusions:
if re.search(exclude, keyname):
return True
return False
cand = []
for k in bucket.list(prefix='pub/thunderbird/candidates/45.2b1-candidates/build2/'):
if not matches_exclude(k.name):
path = k.name.replace('pub/thunderbird/candidates/45.2b1-candidates/build2/','')
cand.append((path, k.etag))
rel = []
for k in bucket.list(prefix='pub/thunderbird/releases/45.2b1/'):
if not matches_exclude(k.name):
path = k.name.replace('pub/thunderbird/releases/45.2b1/', '')
rel.append((path, k.etag))
with open('candidates', 'w') as f:
for k in sorted(cand, reverse=True):
f.write(str(k)+'\n')
with open('releases', 'w') as f:
for k in sorted(rel, reverse=True):
f.write(str(k)+'\n')
# then diff files, so dumb
######## fix, using build slave credentials
from boto.s3.connection import S3Connection
import os.path
locations = (
'win32/zh-TW/Thunderbird Setup 45.2b1.exe',
'win32/zh-CN/Thunderbird Setup 45.2b1.exe',
'win32/vi/Thunderbird Setup 45.2b1.exe',
'win32/uk/Thunderbird Setup 45.2b1.exe',
'win32/tr/Thunderbird Setup 45.2b1.exe',
'win32/gl/Thunderbird Setup 45.2b1.exe',
'win32/gd/Thunderbird Setup 45.2b1.exe',
'win32/ga-IE/Thunderbird Setup 45.2b1.exe',
'win32/fy-NL/Thunderbird Setup 45.2b1.exe',
'win32/fr/Thunderbird Setup 45.2b1.exe',
'win32/fi/Thunderbird Setup 45.2b1.exe',
'update/win32/zh-TW/thunderbird-45.2b1.complete.mar',
'update/win32/zh-TW/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/zh-TW/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/zh-TW/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/zh-CN/thunderbird-45.2b1.complete.mar',
'update/win32/zh-CN/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/zh-CN/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/zh-CN/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/vi/thunderbird-45.2b1.complete.mar',
'update/win32/vi/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/vi/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/vi/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/uk/thunderbird-45.2b1.complete.mar',
'update/win32/uk/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/uk/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/uk/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/tr/thunderbird-45.2b1.complete.mar',
'update/win32/tr/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/tr/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/tr/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/gl/thunderbird-45.2b1.complete.mar',
'update/win32/gl/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/gl/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/gl/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/gd/thunderbird-45.2b1.complete.mar',
'update/win32/gd/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/gd/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/gd/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/ga-IE/thunderbird-45.2b1.complete.mar',
'update/win32/ga-IE/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/ga-IE/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/ga-IE/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/fy-NL/thunderbird-45.2b1.complete.mar',
'update/win32/fy-NL/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/fy-NL/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/fy-NL/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/fr/thunderbird-45.2b1.complete.mar',
'update/win32/fr/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/fr/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/fr/thunderbird-45.0b3-45.2b1.partial.mar',
'update/win32/fi/thunderbird-45.2b1.complete.mar',
'update/win32/fi/thunderbird-45.1b1-45.2b1.partial.mar',
'update/win32/fi/thunderbird-45.0b4-45.2b1.partial.mar',
'update/win32/fi/thunderbird-45.0b3-45.2b1.partial.mar',
'SHA512SUMS',
'SHA512SUMS.asc',
)
conn = S3Connection()
bucket = conn.get_bucket('net-mozaws-prod-delivery-archive')
for l in locations:
source = os.path.join('pub/thunderbird/candidates/45.2b1-candidates/build2', l)
dest = os.path.join('pub/thunderbird/releases/45.2b1', l)
print "copying %s --> %s" % (source, dest)
bucket.copy_key(dest, 'net-mozaws-prod-delivery-archive', source)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment