2019-06-21 12:13:34 +02:00
|
|
|
import datetime
|
|
|
|
import pathlib
|
|
|
|
import sys
|
|
|
|
import json
|
|
|
|
|
|
|
|
import boto3
|
|
|
|
|
|
|
|
dist_folder = pathlib.Path.cwd() / 'dist'
|
|
|
|
|
|
|
|
try:
|
|
|
|
f = next(dist_folder.glob('*.whl'))
|
|
|
|
except StopIteration:
|
|
|
|
print("No .whl files found in ./dist!")
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
print("Uploading", f.name)
|
|
|
|
s3 = boto3.client('s3')
|
2019-07-02 12:20:59 +02:00
|
|
|
s3.upload_file(str(f), 'releases.wagtail.io', 'nightly/dist/' + f.name, ExtraArgs={'ACL':'public-read'})
|
2019-06-21 12:13:34 +02:00
|
|
|
|
|
|
|
print("Updating latest.json")
|
|
|
|
|
|
|
|
boto3.resource('s3').Object('releases.wagtail.io', 'nightly/latest.json').put(Body=json.dumps({
|
2019-07-02 12:20:21 +02:00
|
|
|
"url": 'https://releases.wagtail.io/nightly/dist/' + f.name,
|
2019-06-21 12:13:34 +02:00
|
|
|
}))
|