logging_level = logging.DEBUG
    logging.basicConfig(stream=sys.stdout, level=logging_level,
                        format="%(message)s")

    for opt in ('build_properties', 'release_config', 'api_root', 'credentials_file', 'buildbot_configs', 'username'):
        if not getattr(options, opt):
            print >>sys.stderr, "Required option %s not present" % opt
            sys.exit(1)

    properties = json.load(open(options.build_properties))['properties']
    releaseTag = properties['script_repo_revision']
    hashType = properties['hashType']
    retry(mercurial, args=(options.buildbot_configs, 'buildbot-configs'), kwargs=dict(revision=releaseTag))
    release_config = validate(options)

    credentials = {}
    execfile(options.credentials_file, credentials)
    auth = (options.username, credentials['balrog_credentials'][options.username])
    updateChannels = release_config['testChannels'] + [release_config['releaseChannel']]

    creator = ReleaseCreator(options.api_root, auth)
    creator.run(release_config['appVersion'], release_config['productName'],
                release_config['version'], release_config['buildNumber'],
                release_config['partialUpdates'], updateChannels,
                release_config['stagingServer'], release_config['bouncerServer'],
                release_config['enUSPlatforms'], hashType)

    pusher = ReleasePusher(options.api_root, auth)
    pusher.run(release_config['productName'], release_config['version'],
               release_config['buildNumber'], release_config['testChannelRuleIds'])
Exemple #2
0
                        default=logging.INFO,
                        help="Increase output verbosity")

    args = parser.parse_args()
    logging.basicConfig(format="%(message)s", level=args.loglevel)

    partials = {}
    for v in args.partial_updates:
        version, build_number = v.split("build")
        partials[version] = {"buildNumber": build_number}

    credentials = {}
    execfile(args.credentials_file, credentials)
    auth = (args.username, credentials['balrog_credentials'][args.username])
    creator = ReleaseCreatorV4(args.api_root, auth)
    pusher = ReleasePusher(args.api_root, auth)

    creator.run(appVersion=args.app_version,
                productName=args.product.capitalize(),
                version=args.version,
                buildNumber=args.build_number,
                updateChannels=args.channels,
                ftpServer=args.archive_domain,
                bouncerServer=args.download_domain,
                enUSPlatforms=args.platforms,
                hashFunction=args.hash_function,
                openURL=args.open_url,
                partialUpdates=partials,
                requiresMirrors=args.requires_mirrors)

    pusher.run(productName=args.product.capitalize(),
    properties = json.load(open(options.build_properties))['properties']
    releaseTag = properties['script_repo_revision']
    hashType = properties['hashType']
    retry(mercurial,
          args=(options.buildbot_configs, 'buildbot-configs'),
          kwargs=dict(revision=releaseTag))
    release_config = validate(options)

    credentials = {}
    execfile(options.credentials_file, credentials)
    auth = (options.username,
            credentials['balrog_credentials'][options.username])
    updateChannels = release_config['testChannels'] + [
        release_config['releaseChannel']
    ]

    creator = ReleaseCreator(options.api_root, auth)
    creator.run(release_config['appVersion'],
                release_config['productName'].capitalize(),
                release_config['version'], release_config['buildNumber'],
                release_config['partialUpdates'], updateChannels,
                release_config['stagingServer'],
                release_config['bouncerServer'],
                release_config['enUSPlatforms'], hashType,
                options.schema_version)

    pusher = ReleasePusher(options.api_root, auth)
    pusher.run(release_config['productName'].capitalize(),
               release_config['version'], release_config['buildNumber'],
               release_config['testChannelRuleIds'])
    if options.verbose:
        logging_level = logging.DEBUG
    logging.basicConfig(stream=sys.stdout, level=logging_level,
                        format="%(message)s")

    for opt in ('build_properties', 'release_config', 'api_root', 'credentials_file', 'buildbot_configs', 'username', "release_channel"):
        if not getattr(options, opt):
            print >>sys.stderr, "Required option %s not present" % opt
            sys.exit(1)

    properties = json.load(open(options.build_properties))['properties']

    if properties.get("shipit") != "shipit":
        print >>sys.stderr, "Magic keyword not present in properties, bailing"
        sys.exit(1)

    release_channel = options.release_channel
    releaseTag = properties['script_repo_revision']
    retry(mercurial, args=(options.buildbot_configs, 'buildbot-configs'), kwargs=dict(revision=releaseTag))
    release_config = validate(options)

    credentials = {}
    execfile(options.credentials_file, credentials)
    auth = (options.username, credentials['balrog_credentials'][options.username])

    ruleIds = [release_config["updateChannels"][release_channel]["ruleId"]]

    pusher = ReleasePusher(options.api_root, auth)
    pusher.run(release_config['productName'].capitalize(), release_config['version'],
               release_config['buildNumber'], ruleIds)
    parser.add_argument("-p", "--product", dest="product_name", required=True)
    parser.add_argument("-b", "--build-number", dest="build_number", required=True)
    parser.add_argument("-R", "--rules", dest="rule_ids", action="append", required=True)
    parser.add_argument("-s", "--schedule-at", dest="schedule_at", default=None)
    parser.add_argument("-B", "--background-rate", dest="backgroundRate", default=None)
    parser.add_argument("-v", "--verbose", dest="verbose", action="store_true")
    args = parser.parse_args()

    logging_level = logging.INFO
    if args.verbose:
        logging_level = logging.DEBUG
    logging.basicConfig(stream=sys.stdout, level=logging_level,
                        format="%(message)s")

    credentials = {}
    execfile(args.credentials_file, credentials)
    auth = (args.username, credentials['balrog_credentials'][args.username])

    if args.schedule_at:
        scheduler = ReleaseScheduler(args.api_root, auth)
        if args.backgroundRate:
            scheduler.run(args.product_name.capitalize(), args.version,
                          args.build_number, args.rule_ids, args.schedule_at, args.backgroundRate)
        else:
            scheduler.run(args.product_name.capitalize(), args.version,
                          args.build_number, args.rule_ids, args.schedule_at)
    else:
        pusher = ReleasePusher(args.api_root, auth)
        pusher.run(args.product_name.capitalize(), args.version,
                args.build_number, args.rule_ids, args.backgroundRate)
        const=logging.DEBUG, default=logging.INFO,
        help="Increase output verbosity")

    args = parser.parse_args()
    logging.basicConfig(format="%(message)s", level=args.loglevel)

    partials = {}
    for v in args.partial_updates:
        version, build_number = v.split("build")
        partials[version] = {"buildNumber": build_number}

    credentials = {}
    execfile(args.credentials_file, credentials)
    auth = (args.username, credentials['balrog_credentials'][args.username])
    creator = ReleaseCreatorV4(args.api_root, auth)
    pusher = ReleasePusher(args.api_root, auth)

    creator.run(
        appVersion=args.app_version,
        productName=args.product.capitalize(),
        version=args.version,
        buildNumber=args.build_number,
        updateChannels=args.channels,
        ftpServer=args.archive_domain,
        bouncerServer=args.download_domain,
        enUSPlatforms=args.platforms,
        hashFunction=args.hash_function,
        openURL=args.open_url,
        partialUpdates=partials,
        requiresMirrors=args.requires_mirrors)
from balrog.submitter.cli import ReleasePusher

if __name__ == '__main__':

    from argparse import ArgumentParser
    parser = ArgumentParser()
    parser.add_argument("-a", "--api-root", dest="api_root",required=True)
    parser.add_argument("-c", "--credentials-file", dest="credentials_file", required=True)
    parser.add_argument("-u", "--username", dest="username", required=True)
    parser.add_argument("-V", "--version", dest="version", required=True)
    parser.add_argument("-p", "--product", dest="product_name", required=True)
    parser.add_argument("-b", "--build-number", dest="build_number", required=True)
    parser.add_argument("-R", "--rules", dest="rule_ids", action="append", required=True)
    parser.add_argument("-v", "--verbose", dest="verbose", action="store_true")
    args = parser.parse_args()

    logging_level = logging.INFO
    if args.verbose:
        logging_level = logging.DEBUG
    logging.basicConfig(stream=sys.stdout, level=logging_level,
                        format="%(message)s")

    credentials = {}
    execfile(args.credentials_file, credentials)
    auth = (args.username, credentials['balrog_credentials'][args.username])

    pusher = ReleasePusher(args.api_root, auth)
    pusher.run(args.product_name.capitalize(), args.version,
               args.build_number, args.rule_ids)
Exemple #8
0
def create_pusher(**kwargs):
    from balrog.submitter.cli import ReleasePusher
    return ReleasePusher(**kwargs)
    credentials = {}
    execfile(options.credentials_file, credentials)
    auth = (options.username, credentials["balrog_credentials"][options.username])
    updateChannels = release_config["testChannels"] + [release_config["releaseChannel"]]

    if options.schema_version == 2:
        creator = ReleaseCreatorV2(options.api_root, auth)
    else:
        creator = ReleaseCreatorV3(options.api_root, auth)
    creator.run(
        release_config["appVersion"],
        release_config["productName"].capitalize(),
        release_config["version"],
        release_config["buildNumber"],
        updateChannels,
        release_config["stagingServer"],
        release_config["bouncerServer"],
        release_config["enUSPlatforms"],
        hashType,
        partialUpdates=release_config["partialUpdates"],
    )

    pusher = ReleasePusher(options.api_root, auth)
    pusher.run(
        release_config["productName"].capitalize(),
        release_config["version"],
        release_config["buildNumber"],
        release_config["testChannelRuleIds"],
    )