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

Unified Diff: scripts/slave/recipe_modules/gsutil/api.py

Issue 1274723004: Converted Android Chromedriver buildbot scripts to recipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fixed one of the docstrings Created 4 years, 8 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/recipe_modules/gsutil/api.py
diff --git a/scripts/slave/recipe_modules/gsutil/api.py b/scripts/slave/recipe_modules/gsutil/api.py
index e65ba6ec588d1949eed4dfeebe5a28906af48c15..9f2f9a43a400260c0263b240e5b816bdce9bc119 100644
--- a/scripts/slave/recipe_modules/gsutil/api.py
+++ b/scripts/slave/recipe_modules/gsutil/api.py
@@ -114,6 +114,13 @@ class GSUtilApi(recipe_api.RecipeApi):
result.presentation.links[link_name] = self._http_url(
dest_bucket, dest, unauthenticated_url=unauthenticated_url)
+ def list(self, url, args=None, **kwargs):
+ args = args or []
+ url = self._normalize_url(url)
+ cmd = ['ls'] + args + [url]
+ name = kwargs.pop('name', 'list')
+ return self(cmd, name, **kwargs)
+
def signurl(self, private_key_file, bucket, dest, args=None, **kwargs):
args = args or []
full_source = 'gs://%s/%s' % (bucket, dest)
@@ -154,6 +161,26 @@ class GSUtilApi(recipe_api.RecipeApi):
args,
cwd=self.m.path['slave_build'])
+ def download_latest_file(self, base_url, partial_name, destination,
+ name='Download latest file from GS'):
+ """Get the latest archived object with the given base url and partial name.
+
+ Args:
+ base_url: Base Google Storage archive URL (gs://...) containing the build.
+ partial_name: Partial name of the archive file to download.
+ destination: Destination file/directory where the file will be downloaded.
+ name: The name of the step.
+ """
+ gsutil_download_path = self.m.path['build'].join(
+ 'scripts', 'slave', 'gsutil_download.py')
+ args = ['--url', base_url,
+ '--dst', destination,
+ '--partial-name', partial_name]
+ return self.m.python(name,
+ gsutil_download_path,
+ args,
+ cwd=self.m.path['slave_build'])
+
def _generate_metadata_args(self, metadata):
result = []
if metadata:

Powered by Google App Engine
This is Rietveld 408576698