0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 05:02:57 +01:00
wagtail/scripts/nightly/upload.py
Matt Westcott 9947b955da Lint config fixes (#6473)
Ref #6463, #6428

* pin isort to 5.6.4
* update isort version mentioned in python_guidelines.rst
* make lint commands consistent between make lint and circleci
* fix isort errors on files outside of /wagtail
* speed up isort by ignoring additional directories and filetypes
2020-10-19 21:33:10 +01:00

28 lines
615 B
Python

import json
import pathlib
import sys
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')
s3.upload_file(str(f), 'releases.wagtail.io', 'nightly/dist/' + f.name, ExtraArgs={'ACL': 'public-read'})
print("Updating latest.json")
boto3.resource('s3').Object('releases.wagtail.io', 'nightly/latest.json').put(
ACL='public-read',
Body=json.dumps({
"url": 'https://releases.wagtail.io/nightly/dist/' + f.name,
})
)