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

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 nits. Created 4 years, 5 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
« no previous file with comments | « scripts/slave/recipe_modules/file/api.py ('k') | scripts/slave/recipe_modules/gsutil/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3aafe2e2de39843be975c89b5a12c9f3f0080181..155bd035b2c212d0d47680d45fa17eee159c6a8b 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:
« no previous file with comments | « scripts/slave/recipe_modules/file/api.py ('k') | scripts/slave/recipe_modules/gsutil/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698