Exemplo n.º 1
0
def close(snap_name, channels):
    """Close <channel> for <snap-name>.
    Closing a channel allows the <channel> that is closed to track the channel
    that follows it in the channel release chain. As such closing the
    'candidate' channel would make it track the 'stable' channel.

    The channel map will be displayed after the operation takes place.

    \b
    Examples:
        snapcraft close my-snap beta
        snapcraft close my-snap beta edge
    """
    snapcraft.close(snap_name, channels)
Exemplo n.º 2
0
def close(snap_name, channels):
    """Close <channel> for <snap-name>.
    Closing a channel allows the <channel> that is closed to track the channel
    that follows it in the channel release chain. As such closing the
    'candidate' channel would make it track the 'stable' channel.

    The channel map will be displayed after the operation takes place.

    \b
    Examples:
        snapcraft close my-snap beta
        snapcraft close my-snap beta edge
    """
    snapcraft.close(snap_name, channels)
Exemplo n.º 3
0
def _run_store_command(args):  # noqa: C901
    if args['list-registered'] or args['registered']:
        snapcraft.list_registered()
    elif args['list-keys'] or args['keys']:
        snapcraft.list_keys()
    elif args['create-key']:
        snapcraft.create_key(args['<key-name>'])
    elif args['register-key']:
        snapcraft.register_key(args['<key-name>'])
    elif args['register']:
        snapcraft.register(args['<snap-name>'], args['--private'])
    elif args['sign-build']:
        snapcraft.sign_build(
            args['<snap-file>'], args['--key-name'], args['--local'])
    elif args['upload']:
        logger.warning('DEPRECATED: Use `push` instead of `upload`')
        snapcraft.push(args['<snap-file>'])
    elif args['push']:
        if args['--release']:
            release_channels = args['--release'].split(',')
        else:
            release_channels = []
        snapcraft.push(args['<snap-file>'], release_channels)
    elif args['release']:
        snapcraft.release(
            args['<snap-name>'], args['<revision>'], [args['<channel>']])
    elif args['validate']:
        snapcraft.validate(args['<snap-name>'], args['<validation>'],
                           key=args['--key-name'])
    elif args['gated']:
        snapcraft.gated(args['<snap-name>'])
    elif args['status']:
        snapcraft.status(
            args['<snap-name>'], args['--series'], args['--arch'])
    elif args['revisions'] or args['list-revisions'] or args['history']:
        if args['history']:
            deprecations.handle_deprecation_notice('dn4')
        snapcraft.revisions(
            args['<snap-name>'], args['--series'], args['--arch'])
    elif args['close']:
        snapcraft.close(args['<snap-name>'], args['<channel_names>'])
    elif args['collaborate']:
        snapcraft.collaborate(args['<snap-name>'], key=args['--key-name'])
Exemplo n.º 4
0
def _run_store_command(args):  # noqa: C901
    if args['list-registered'] or args['registered']:
        snapcraft.list_registered()
    elif args['list-keys'] or args['keys']:
        snapcraft.list_keys()
    elif args['create-key']:
        snapcraft.create_key(args['<key-name>'])
    elif args['register-key']:
        snapcraft.register_key(args['<key-name>'])
    elif args['register']:
        snapcraft.register(args['<snap-name>'], args['--private'])
    elif args['sign-build']:
        snapcraft.sign_build(
            args['<snap-file>'], args['--key-name'], args['--local'])
    elif args['upload']:
        logger.warning('DEPRECATED: Use `push` instead of `upload`')
        snapcraft.push(args['<snap-file>'])
    elif args['push']:
        if args['--release']:
            release_channels = args['--release'].split(',')
        else:
            release_channels = []
        snapcraft.push(args['<snap-file>'], release_channels)
    elif args['release']:
        snapcraft.release(
            args['<snap-name>'], args['<revision>'], [args['<channel>']])
    elif args['validate']:
        snapcraft.validate(args['<snap-name>'], args['<validation>'],
                           key=args['--key-name'])
    elif args['gated']:
        snapcraft.gated(args['<snap-name>'])
    elif args['status']:
        snapcraft.status(
            args['<snap-name>'], args['--series'], args['--arch'])
    elif args['revisions'] or args['list-revisions'] or args['history']:
        if args['history']:
            deprecations.handle_deprecation_notice('dn4')
        snapcraft.revisions(
            args['<snap-name>'], args['--series'], args['--arch'])
    elif args['close']:
        snapcraft.close(args['<snap-name>'], args['<channel_names>'])
Exemplo n.º 5
0
def close(snap_name, channels):
    """Close <channel> for <snap-name>.
    Closing a channel allows the <channel> that is closed to track the channel
    that follows it in the channel release chain. As such closing the
    'candidate' channel would make it track the 'stable' channel.

    The channel map will be displayed after the operation takes place.

    \b
    Examples:
        snapcraft close my-snap beta
        snapcraft close my-snap beta edge
    """
    try:
        snapcraft.close(snap_name, channels)
    except storeapi.errors.StoreError as e:
        echo.error(e)
        sys.exit(1)
    # This one is here until an assertions refactor
    except KeyError:
        sys.exit(1)