Commit be126fc4 authored by blundell's avatar blundell Committed by Commit bot

Publish location files for Mojo binaries uploaded from Chromium.

This CL is a companion to https://codereview.chromium.org/945423002, and will
allow a server app to serve apps that were uploaded to the Mojo bucket in GS
from Chromium without having to know anything about these apps in particular.

Review URL: https://codereview.chromium.org/956593003

Cr-Commit-Position: refs/heads/master@{#319070}
parent d8c2eacf
...@@ -74,8 +74,19 @@ def upload_binary(service, binary_dir, platform, dry_run): ...@@ -74,8 +74,19 @@ def upload_binary(service, binary_dir, platform, dry_run):
absolute_binary_path = os.path.join(root_path, binary_dir, binary_name) absolute_binary_path = os.path.join(root_path, binary_dir, binary_name)
if not should_zip: if not should_zip:
# Upload the binary.
dest = dest_dir + binary_name dest = dest_dir + binary_name
gsutil_cp(absolute_binary_path, dest, dry_run) gsutil_cp(absolute_binary_path, dest, dry_run)
# Update the pointer to the service's location to point to the
# newly-uploaded binary.
service_location = dest.replace("gs://", "https://storage.googleapis.com/")
location_file = ("gs://mojo/services/" + platform + "/" + service +
"_location")
with tempfile.NamedTemporaryFile() as tmp:
tmp.write(service_location)
tmp.flush()
gsutil_cp(tmp.name, location_file, dry_run)
return return
# Zip the binary before uploading it to the cloud. # Zip the binary before uploading it to the cloud.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment