blob: 22905aa2e853d28cbbbf74fe84e2d88346827822 [file] [log] [blame]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Uploads termina to the correct gsutil buckets.
This script is designed to automate some of go/crostini-infra-playbook. It
should be run after
import argparse
import os
import subprocess
import tempfile
def upload_termina(termina_dir, milestone, build):
"""Uploads termina images to omaha bucket.
After running you can run this script to put the new images
in the right gs buckets.
termina_dir: Directory where stored the images.
milestone: Chrome milestone for this build.
build: CrOS build which created these termina images.
Exception: if termina_dir is not a directory.
if not os.path.isdir(termina_dir):
raise Exception("Can not locate termina directory: " + termina_dir)
omaha_url = "gs://chrome-component-termina/{}".format(build)
for image, arch in [("tatl", "intel64"), ("tael", "arm32"),
("tael", "arm64")]:
local_copy = os.path.join(termina_dir, image, "")
remote_copy = "{}/chromeos_{}-archive/".format(omaha_url, arch)
["", "--", "cp", "-a", "public-read", local_copy, remote_copy])
def main():
parser = argparse.ArgumentParser(description=__doc__)
"--milestone", required=True, help="milestone number, e.g. 78")
"--build", required=True, help="build number, e.g. 11396.0.0")
help="directory where stored its results")
args = parser.parse_args()
upload_termina(args.dir, args.milestone,
if __name__ == "__main__":