# HG changeset patch # User cltbld@localhost.localdomain # Date 1286986890 25200 # Node ID f1dd1069f53db51b0491105adc50b4277ea0251b initial packaging of sendchanges script diff -r 000000000000 -r f1dd1069f53d sendchanges/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sendchanges/__init__.py Wed Oct 13 09:21:30 2010 -0700 @@ -0,0 +1,1 @@ +# diff -r 000000000000 -r f1dd1069f53d sendchanges/sendchanges.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sendchanges/sendchanges.py Wed Oct 13 09:21:30 2010 -0700 @@ -0,0 +1,103 @@ +#!/usr/bin/env python + +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla.org. +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Jeff Hammel (Original author) +# +# Alternatively, the contents of this file may be used under the terms of +# either of the GNU General Public License Version 2 or later (the "GPL"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +""" +forces sendchanges to test mozilla-central builds for all platforms +usage +sendchange master_port_number +author: Alice Nodelman +""" + +# globals +platforms = ['win32', 'linux', 'linux64', 'macosx64'] +branches = ['talos', 'opt-unittest', 'debug-unittest'] +ports = ['9010', '9012'] + +# parse options +from optparse import OptionParser +parser = OptionParser(description=__doc__) +parser.add_option('-p', '--port', dest='port', + choices=ports, type='choice', + help='buildbot masteir port number to push sendchanges to (choices: %s)' % ports) +parser.add_option('--branch', dest='branch', + choices=branches, type='choice', + help='which branch to push (choices: %s)' % branches) +parser.add_option('-u', '--url', dest='url', + default=None, + help='base url where the builds live') +parser.add_option('--platform', dest='platforms', action='append', + help='which platforms to run on, all by default (choices: %s)' % platforms) + +options, args = parser.parse_args() + +if not options.platforms: + options.platforms = platforms + +if not options.port: + parser.error("Error - please specify a buildbot master port number to push sendchanges to (9010 or 9012)") + +if not options.branch: + parser.error("Error - please specify your branch") + +# get the changes +from getlatesttinderbox import GetLatestTinderbox +changes = {} +for platform in options.platforms: + if args: + changes[platform] = args + continue + latest = GetLatestTinderbox(platform=platform) + _changes = [ latest.latest_build_url(options.url) ] + if options.branch != 'talos': + _changes.append(latest.latest_tests_url(options.url)) + _changes.append(latest.latest_symbols_url(options.url)) + if None in _changes: + raise AssertionError("You mess something up! %s %s %s" % (platform, options.url, _changes)) + changes[platform] = _changes + +# send the changes +from subprocess import check_call +USERNAME="sendchange_script" +for platform in options.platforms: + check_call(['buildbot', 'sendchange', + '--user', USERNAME, + '--master', 'localhost:%d' % int(options.port), + '--branch', 'mozilla-central-%s-%s' % (platform, options.branch)] + + changes[platform]) + diff -r 000000000000 -r f1dd1069f53d setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Wed Oct 13 09:21:30 2010 -0700 @@ -0,0 +1,62 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla.org. +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Jeff Hammel (Original author) +# +# Alternatively, the contents of this file may be used under the terms of +# either of the GNU General Public License Version 2 or later (the "GPL"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +from setuptools import setup, find_packages +import sys, os + +version = '0.0' + +setup(name='sendchanges', + version=version, + description="sendchanges script for Mozilla buildbot", + long_description="""\ +""", + classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + keywords='mozilla buildbot', + author='Jeff Hammel', + author_email='jhammel@mozilla.com', + url='http://k0s.org/mozilla/', + license='MPL', + packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), + include_package_data=True, + zip_safe=False, + install_requires=[ + # -*- Extra requirements: -*- + ], + entry_points=""" + # -*- Entry points: -*- + """, + )