예제 #1
0
def run(args, project_options):
    lifecycle_command = _get_lifecycle_command(args)
    argless_command = _get_command_from_arg(args)
    if lifecycle_command:
        lifecycle.execute(lifecycle_command, project_options, args['<part>'])
    elif argless_command:
        argless_command()
    elif args['clean']:
        step = args['--step']
        if step == 'strip':
            logger.warning('DEPRECATED: Use `prime` instead of `strip` '
                           'as the step to clean')
            step = 'prime'
        lifecycle.clean(project_options, args['<part>'], step)
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])
    elif args['cleanbuild']:
        lifecycle.cleanbuild(project_options),
    elif args['tour']:
        _scaffold_examples(args['<directory>'] or _SNAPCRAFT_TOUR_DIR)
    elif args['help']:
        snapcraft.topic_help(args['<topic>'] or args['<plugin>'],
                             args['--devel'], args['topics'])
    else:  # snap by default:
        lifecycle.snap(project_options, args['<directory>'], args['--output'])

    return project_options
예제 #2
0
파일: main.py 프로젝트: didrocks/snapcraft
def run(args, project_options):
    lifecycle_command = _get_lifecycle_command(args)
    argless_command = _get_command_from_arg(args)
    if lifecycle_command:
        lifecycle.execute(
            lifecycle_command, project_options, args['<part>'])
    elif argless_command:
        argless_command()
    elif args['clean']:
        step = args['--step']
        if step == 'strip':
            logger.warning('DEPRECATED: Use `prime` instead of `strip` '
                           'as the step to clean')
            step = 'prime'
        lifecycle.clean(project_options, args['<part>'], step)
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])
    elif args['cleanbuild']:
        lifecycle.cleanbuild(project_options),
    # disable until the tour command is activated
    # elif args['tour']:
    #    _scaffold_examples(args['<directory>'] or _SNAPCRAFT_TOUR_DIR)
    elif args['help']:
        snapcraft.topic_help(args['<topic>'] or args['<plugin>'],
                             args['--devel'], args['topics'])
    else:  # snap by default:
        lifecycle.snap(project_options, args['<directory>'], args['--output'])

    return project_options
예제 #3
0
def upload(snap_file, release):
    """Upload <snap-file> to the store.

    By passing --release with a comma separated list of channels the snap would
    be released to the selected channels if the store review passes for this
    <snap-file>.

    This operation will block until the store finishes processing this
    <snap-file>.

    If --release is used, the channel map will be displayed after the
    operation takes place.

    \b
    Examples:
        snapcraft upload my-snap_0.1_amd64.snap
        snapcraft upload my-snap_0.2_amd64.snap --release edge
        snapcraft upload my-snap_0.3_amd64.snap --release candidate,beta
    """
    click.echo("Preparing to upload {!r}.".format(os.path.basename(snap_file)))
    if release:
        channel_list = release.split(",")
        click.echo(
            "After uploading, the resulting snap revision will be released to "
            "{} when it passes the Snap Store review."
            "".format(formatting_utils.humanize_list(channel_list, "and")))
    else:
        channel_list = None

    review_snap(snap_file=snap_file)
    snapcraft.upload(snap_file, channel_list)
예제 #4
0
파일: main.py 프로젝트: M0ses/snapcraft
def _run_store_command(args):
    if args['register']:
        snapcraft.register(args['<snap-name>'])
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])
    elif args['release']:
        snapcraft.release(
            args['<snap-name>'], args['<revision>'], args['<channel>'])
예제 #5
0
파일: main.py 프로젝트: fallen/snapcraft
def run(args, project_options):
    lifecycle_command = _get_lifecycle_command(args)
    argless_command = _get_command_from_arg(args)
    if lifecycle_command:
        snapcraft.lifecycle.execute(
            lifecycle_command, project_options, args['<part>'])
    elif argless_command:
        argless_command()
    elif args['clean']:
        snapcraft.lifecycle.clean(args['<part>'], args['--step'])
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])
    elif args['help']:
        snapcraft.topic_help(args['<topic>'] or args['<plugin>'],
                             args['--devel'], args['topics'])
    else:  # snap by default:
        snapcraft.lifecycle.snap(
            project_options, args['<directory>'], args['--output'])
예제 #6
0
def run(args, project_options):
    lifecycle_command = _get_lifecycle_command(args)
    argless_command = _get_command_from_arg(args)
    if lifecycle_command:
        lifecycle.execute(lifecycle_command, project_options, args['<part>'])
    elif argless_command:
        argless_command()
    elif args['clean']:
        lifecycle.clean(project_options, args['<part>'], args['--step'])
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])
    elif args['cleanbuild']:
        lifecycle.cleanbuild(project_options),
    elif args['help']:
        snapcraft.topic_help(args['<topic>'] or args['<plugin>'],
                             args['--devel'], args['topics'])
    else:  # snap by default:
        lifecycle.snap(project_options, args['<directory>'], args['--output'])

    return project_options
예제 #7
0
파일: main.py 프로젝트: cjwatson/snapcraft
def _run_store_command(args):
    if args['register']:
        snapcraft.register(args['<snap-name>'])
    elif args['upload']:
        snapcraft.upload(args['<snap-file>'])