# HG changeset patch # User Jeff Hammel # Date 1296685601 28800 # Node ID 5257c9abea506c5edfd528f5b2b9a998f689f173 # Parent 44f82980244272ad663c9d1795cfd4d24cd07a61 now we should at least download firefox, in theory diff -r 44f829802442 -r 5257c9abea50 autobot/process/factory.py --- a/autobot/process/factory.py Wed Feb 02 11:53:52 2011 -0800 +++ b/autobot/process/factory.py Wed Feb 02 14:26:41 2011 -0800 @@ -8,6 +8,9 @@ from buildbot.steps.shell import ShellCommand from buildbot.steps.shell import WithProperties + +### utility functions; could go elsewhere + def find(*args): """ returns a command to echo the found file cross-platform @@ -16,12 +19,20 @@ command = 'if %s; else false; fi' % '; elif '.join(args) return ['bash', '-c', command] +def url_basename(returncode, stdout, stderr): + """ + extract the end part of the URL ~ the basename + """ + return stdout.rsplit('/', 1)[-1] + +### factories + class FirefoxDownloaderFactory(BuildFactory): """ factory to aid in downloading Firefox """ - def __init__(self, base_url=None): + def __init__(self, platform, base_url=None): # determine the (damn) url script = 'get-latest-tinderbox' @@ -34,6 +45,23 @@ haltOnFailure=True )) + # get the filename + self.addStep(SetProperty(property='firefox_bundle', + command=['echo', WithProperties('%(firefox_url)s')], + extract_fn=url_basename)) + + # download Firefox + self.addStep(ShellCommand(command=['wget', + WithProperties('%(firefox_url)s'), + '-O', + WithProperties('%(firefox_bundle)s')], + haltOnFailure=True)) + + # three cases: + # - linux has firefox in a .tar.bz2 file + # - mac has firefox in a .dmg file [TODO] + # - windows has firefox in a .zip file + class SourceFactory(BuildFactory): """ diff -r 44f829802442 -r 5257c9abea50 autobot/projects/mozmill/__init__.py --- a/autobot/projects/mozmill/__init__.py Wed Feb 02 11:53:52 2011 -0800 +++ b/autobot/projects/mozmill/__init__.py Wed Feb 02 14:26:41 2011 -0800 @@ -12,7 +12,7 @@ # VCS sources = {'git': ['http://github.com/mozautomation/mozmill.git']} - def __init__(self, platform=None, git=None, firefox_url=None, + def __init__(self, platform, git=None, firefox_url=None, tests='http://hg.mozilla.org/qa/mozmill-tests'): # setup the environment