mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Update S3 update deploy script
This commit is contained in:
parent
3a2a6bb9ec
commit
96a0509610
|
@ -20,9 +20,11 @@ prefix = "/qtox/win32/" # We only support Windows for now
|
|||
conn = boto.connect_s3()
|
||||
bucket = conn.get_bucket('qtox-updater')
|
||||
print("Connected to S3")
|
||||
sys.stdout.flush()
|
||||
|
||||
# Delete the old version, so nobody downloads a half-uploaded update
|
||||
print("Deleting version ...")
|
||||
sys.stdout.flush()
|
||||
oldversion = Key(bucket)
|
||||
oldversion.key = prefix+'version'
|
||||
bucket.delete_key(oldversion)
|
||||
|
@ -31,6 +33,7 @@ bucket.delete_key(oldversion)
|
|||
filenames = next(os.walk(localpath+prefix+'/files/'))[2]
|
||||
for filename in filenames:
|
||||
print("Uploading files/"+filename+'...')
|
||||
sys.stdout.flush()
|
||||
k = Key(bucket)
|
||||
k.key = prefix+'files/'+filename
|
||||
k.set_contents_from_filename(localpath+prefix+'/files/'+filename)
|
||||
|
@ -38,12 +41,14 @@ for filename in filenames:
|
|||
|
||||
# Upload version and flist
|
||||
print("Uploading flist...")
|
||||
sys.stdout.flush()
|
||||
flist = Key(bucket)
|
||||
flist.key = prefix+'flist'
|
||||
flist.set_contents_from_filename(localpath+prefix+'flist')
|
||||
flist.make_public()
|
||||
|
||||
print("Uploading version...")
|
||||
sys.stdout.flush()
|
||||
version = Key(bucket)
|
||||
version.key = prefix+'version'
|
||||
version.set_contents_from_filename(localpath+prefix+'version')
|
||||
|
|
Loading…
Reference in New Issue
Block a user