コード例 #1
0
def main():
    parser = argparse.ArgumentParser(
        description='Code sign and package Chrome for channel distribution.')
    parser.add_argument('--keychain',
                        help='The keychain to load the identity from.')
    parser.add_argument('--identity',
                        required=True,
                        help='The identity to sign with.')
    parser.add_argument('--development', action='store_true',
            help='The specified identity is for development. ' \
                 'Certain codesign requirements will be omitted.')
    parser.add_argument('--input', required=True,
            help='Path to the input directory. The input directory should ' \
                    'contain the products to sign, as well as the Packaging ' \
                    'directory.')
    parser.add_argument('--output', required=True,
            help='Path to the output directory. The signed DMG products and ' \
                    'installer tools will be placed here.')
    parser.add_argument(
        '--no-dmg',
        action='store_true',
        help='Only sign Chrome and do not package the bundle into a DMG.')
    args = parser.parse_args()

    config = create_config(args.identity, args.keychain, args.development)
    paths = model.Paths(args.input, args.output, None)

    if not os.path.exists(paths.output):
        os.mkdir(paths.output)

    pipeline.sign_all(paths, config, package_dmg=not args.no_dmg)
コード例 #2
0
def main():
    parser = argparse.ArgumentParser(
        description='Code sign and package Chrome for channel distribution.')
    parser.add_argument(
        '--identity',
        required=True,
        help='The identity to sign everything but PKGs with.')
    parser.add_argument(
        '--installer-identity', help='The identity to sign PKGs with.')
    parser.add_argument(
        '--notary-user',
        help='The username used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--notary-password',
        help='The password or password reference (e.g. @keychain, see '
        '`xcrun altool -h`) used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--notary-asc-provider',
        help='The ASC provider string to be used as the `--asc-provider` '
        'argument to `xcrun altool`, to be used when --notary-user is '
        'associated with multiple Apple developer teams. See `xcrun altool -h. '
        'Run `iTMSTransporter -m provider -account_type itunes_connect -v off '
        '-u USERNAME -p PASSWORD` to list valid providers.')
    parser.add_argument(
        '--notary-team-id',
        help='The Apple Developer Team ID used to authenticate to the Apple '
        'notary service.')
    parser.add_argument(
        '--notarization-tool',
        choices=list(model.NotarizationTool),
        type=model.NotarizationTool,
        default=None,
        help='The tool to use to communicate with the Apple notary service.')
    parser.add_argument(
        '--development',
        action='store_true',
        help='The specified identity is for development. Certain codesign '
        'requirements will be omitted.')
    parser.add_argument(
        '--input',
        required=True,
        help='Path to the input directory. The input directory should '
        'contain the products to sign, as well as the Packaging directory.')
    parser.add_argument(
        '--output',
        required=True,
        help='Path to the output directory. The signed (possibly packaged) '
        'products and installer tools will be placed here.')
    parser.add_argument(
        '--disable-packaging',
        action='store_true',
        help='Disable creating any packaging (.dmg/.pkg) specified by the '
        'configuration.')
    parser.add_argument(
        '--skip-brand',
        dest='skip_brands',
        action='append',
        default=[],
        help='Causes any distribution whose brand code matches to be skipped. '
        'A value of * matches all brand codes.')
    parser.add_argument(
        '--channel',
        dest='channels',
        action='append',
        default=[],
        help='If provided, only the distributions matching the specified '
        'channel(s) will be produced. The string "stable" matches the None '
        'channel.')
    parser.add_argument(
        '--notarize',
        nargs='?',
        choices=model.NotarizeAndStapleLevel.valid_strings(),
        const='staple',
        default='none',
        help='Specifies the requested notarization actions to be taken. '
        '`none` causes no notarization tasks to be performed. '
        '`nowait` submits the signed application and packaging to Apple for '
        'notarization, but does not wait for a reply. '
        '`wait-nostaple` submits the signed application and packaging to Apple '
        'for notarization, and waits for a reply, but does not staple the '
        'resulting notarization ticket. '
        '`staple` submits the signed application and packaging to Apple for '
        'notarization, waits for a reply, and staples the resulting '
        'notarization ticket. '
        'If the `--notarize` argument is not present, that is the equivalent '
        'of `--notarize none`. If the `--notarize` argument is present but '
        'has no option specified, that is the equivalent of `--notarize '
        'staple`.')

    args = parser.parse_args()

    notarization = model.NotarizeAndStapleLevel.from_string(args.notarize)
    if notarization.should_notarize():
        if not args.notary_user or not args.notary_password:
            parser.error('The `--notary-user` and `--notary-password` '
                         'arguments are required if notarizing.')

    config = create_config(
        model.pick(args, (
            'identity',
            'installer_identity',
            'notary_user',
            'notary_password',
            'notary_asc_provider',
            'notary_team_id',
            'notarization_tool',
        )), args.development)

    if config.notarization_tool == model.NotarizationTool.NOTARYTOOL:
        # Let the config override notary_team_id, including a potentially
        # unspecified argument.
        if not config.notary_team_id:
            parser.error('The `--notarization-tool=notarytool` option requires '
                         'a --notary-team-id.')

    paths = model.Paths(args.input, args.output, None)

    if not os.path.exists(paths.output):
        os.mkdir(paths.output)

    _show_tool_versions()

    pipeline.sign_all(
        paths,
        config,
        disable_packaging=args.disable_packaging,
        notarization=notarization,
        skip_brands=args.skip_brands,
        channels=args.channels)
コード例 #3
0
def main():
    parser = argparse.ArgumentParser(
        description='Code sign and package Chrome for channel distribution.')
    parser.add_argument(
        '--keychain', help='The keychain to load the identity from.')
    parser.add_argument(
        '--identity', required=True, help='The identity to sign with.')
    parser.add_argument(
        '--notary-user',
        help='The username used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--notary-password',
        help='The password or password reference (e.g. @keychain, see '
        '`xcrun altool -h`) used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--development',
        action='store_true',
        help='The specified identity is for development. Certain codesign '
        'requirements will be omitted.')
    parser.add_argument(
        '--input',
        required=True,
        help='Path to the input directory. The input directory should '
        'contain the products to sign, as well as the Packaging directory.')
    parser.add_argument(
        '--output',
        required=True,
        help='Path to the output directory. The signed DMG products and '
        'installer tools will be placed here.')

    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument(
        '--dmg',
        dest='dmg',
        action='store_true',
        help='Defaults to True. Package the signed application into a DMG, '
        'and sign the result.')
    group.add_argument('--no-dmg', dest='dmg', action='store_false')

    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument(
        '--notarize',
        dest='notarize',
        action='store_true',
        help='Defaults to False. Submit the signed application and DMG to '
        'Apple for notarization.')
    group.add_argument('--no-notarize', dest='notarize', action='store_false')

    parser.set_defaults(dmg=True, notarize=False)
    args = parser.parse_args()

    if args.notarize:
        if not args.notary_user or not args.notary_password:
            parser.error('The --notary-user and --notary-password arguments '
                         'are required with --notarize.')

    config = create_config(
        (args.identity, args.keychain, args.notary_user, args.notary_password),
        args.development)
    paths = model.Paths(args.input, args.output, None)

    if not os.path.exists(paths.output):
        os.mkdir(paths.output)

    pipeline.sign_all(
        paths, config, package_dmg=args.dmg, do_notarization=args.notarize)
コード例 #4
0
ファイル: sign_chrome.py プロジェクト: yuming2x/chromium
def main():
    parser = argparse.ArgumentParser(
        description='Code sign and package Chrome for channel distribution.')
    parser.add_argument('--keychain',
                        help='The keychain to load the identity from.')
    parser.add_argument('--identity',
                        required=True,
                        help='The identity to sign everything but PKGs with.')
    parser.add_argument('--installer-identity',
                        help='The identity to sign PKGs with.')
    parser.add_argument(
        '--notary-user',
        help='The username used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--notary-password',
        help='The password or password reference (e.g. @keychain, see '
        '`xcrun altool -h`) used to authenticate to the Apple notary service.')
    parser.add_argument(
        '--notary-asc-provider',
        help='The ASC provider string to be used as the `--asc-provider` '
        'argument to `xcrun altool`, to be used when --notary-user is '
        'associated with multiple Apple developer teams. See `xcrun altool -h. '
        'Run `iTMSTransporter -m provider -account_type itunes_connect -v off '
        '-u USERNAME -p PASSWORD` to list valid providers.')
    parser.add_argument(
        '--development',
        action='store_true',
        help='The specified identity is for development. Certain codesign '
        'requirements will be omitted.')
    parser.add_argument(
        '--input',
        required=True,
        help='Path to the input directory. The input directory should '
        'contain the products to sign, as well as the Packaging directory.')
    parser.add_argument(
        '--output',
        required=True,
        help='Path to the output directory. The signed (possibly packaged) '
        'products and installer tools will be placed here.')
    parser.add_argument(
        '--disable-packaging',
        action='store_true',
        help='Disable creating any packaging (.dmg/.pkg) specified by the '
        'configuration.')
    parser.add_argument(
        '--skip-brand',
        dest='skip_brands',
        action='append',
        default=[],
        help='Causes any distribution whose brand code matches to be skipped.')

    group = parser.add_mutually_exclusive_group(required=False)
    group.add_argument(
        '--notarize',
        dest='notarize',
        action='store_true',
        help='Defaults to False. Submit the signed application and DMG to '
        'Apple for notarization.')
    group.add_argument('--no-notarize', dest='notarize', action='store_false')

    parser.set_defaults(notarize=False)
    args = parser.parse_args()

    if args.notarize:
        if not args.notary_user or not args.notary_password:
            parser.error('The --notary-user and --notary-password arguments '
                         'are required with --notarize.')

    config = create_config(
        (args.identity, args.installer_identity, args.keychain,
         args.notary_user, args.notary_password, args.notary_asc_provider),
        args.development)
    paths = model.Paths(args.input, args.output, None)

    if not os.path.exists(paths.output):
        os.mkdir(paths.output)

    pipeline.sign_all(paths,
                      config,
                      disable_packaging=args.disable_packaging,
                      do_notarization=args.notarize,
                      skip_brands=args.skip_brands)