summaryrefslogtreecommitdiffstats
path: root/jjb/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/scripts')
-rw-r--r--jjb/scripts/publish_library_py.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/jjb/scripts/publish_library_py.sh b/jjb/scripts/publish_library_py.sh
index f9b6a378c..a6e2edfaa 100644
--- a/jjb/scripts/publish_library_py.sh
+++ b/jjb/scripts/publish_library_py.sh
@@ -126,25 +126,22 @@ def upload(s3_resource, s3_bucket, src_fpath, s3_path):
:type src_fpath: str
:type s3_path: str
"""
+ mime = MimeTypes().guess_type(src_fpath)[0]
+ encoding = MimeTypes().guess_type(src_fpath)[1]
+
extra_args = {
u"ContentType": u"text/plain"
}
text_html_extra_args = {
- u"ContentType": u"text/html",
- u"ContentEncoding": MimeTypes().guess_type(src_fpath)[1]
+ u"ContentType": u"text/html"
}
text_plain_extra_args = {
- u"ContentType": u"text/plain",
- u"ContentEncoding": MimeTypes().guess_type(src_fpath)[1]
+ u"ContentType": u"text/plain"
}
app_xml_extra_args = {
- u"ContentType": u"application/xml",
- u"ContentEncoding": MimeTypes().guess_type(src_fpath)[1]
+ u"ContentType": u"application/xml"
}
- mime = MimeTypes().guess_type(src_fpath)[0]
- encoding = MimeTypes().guess_type(src_fpath)[1]
-
if mime is None and encoding is None:
extra_args = extra_args
elif mime is None or mime in u"text/plain":
@@ -156,6 +153,9 @@ def upload(s3_resource, s3_bucket, src_fpath, s3_path):
else:
extra_args = extra_args
+ if encoding:
+ extra_args[u"ContentEncoding"] = encoding
+
try:
s3_resource.Bucket(s3_bucket).upload_file(
src_fpath, s3_path, ExtraArgs=extra_args
@@ -250,7 +250,7 @@ def deploy_s3(s3_bucket, s3_path, build_url, workspace):
except KeyError:
s3_resource = boto3.resource(
u"s3"
- )
+ )
previous_dir = os.getcwd()
work_dir = tempfile.mkdtemp(prefix="backup-s3.")