Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: scripts/slave/zip_build.py

Issue 2112413002: Allowing zip_build to use a file name given in build_url. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/zip_build.py
diff --git a/scripts/slave/zip_build.py b/scripts/slave/zip_build.py
index 2541e8b3b818d9d016689efd39180b34cadf9e44..abf7741439d603f74cf221ce05fd94e39f173086 100755
--- a/scripts/slave/zip_build.py
+++ b/scripts/slave/zip_build.py
@@ -199,6 +199,12 @@ def MakeVersionedArchive(zip_file, file_suffix, options):
zip_base, zip_ext = os.path.splitext(zip_template)
# Create a versioned copy of the file.
versioned_file = zip_file.replace(zip_ext, file_suffix + zip_ext)
+ # Allow for overriding the name of the file based on the given upload url.
+ if options.override_archive_name:
+ new_build_url, new_archive_name = options.build_url.rsplit('/', 1)
+ if new_archive_name and new_archive_name.endswith('.zip'):
+ options.build_url = new_build_url
+ versioned_file = zip_file.replace(zip_template, new_archive_name)
if os.path.exists(versioned_file):
# This file already exists. Maybe we are doing a clobber build at the same
# revision. We can move this file away.
@@ -215,6 +221,7 @@ def MakeVersionedArchive(zip_file, file_suffix, options):
def UploadToGoogleStorage(versioned_file, revision_file, build_url, gs_acl,
gsutil_py_path=None):
+
override_gsutil = None
if gsutil_py_path:
override_gsutil = [sys.executable, gsutil_py_path]
@@ -433,6 +440,9 @@ def main(argv):
option_parser.add_option('--build-url', default='',
help=('Optional URL to which to upload build '
'(overrides build_url factory property)'))
+ option_parser.add_option('--override-archive-name', action='store_true',
martiniss 2016/07/06 21:28:47 Maybe name this '--use-build-url-name' instead? Ov
RobertoCN 2016/07/06 22:06:49 Done.
+ help=('Use the filename given in --build-url instead'
+ 'of generating one.'))
option_parser.add_option('--cros-board',
help=('If building for Chrom[e|ium]OS via the '
'simple chrome workflow, the name of the '
« scripts/slave/recipe_modules/archive/api.py ('K') | « scripts/slave/recipe_modules/archive/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698