Пример #1
0
def cli(box, provision_with):
    """
    Starts the given box and provision it
    """
    try:
        return start_box(box, provision_with)
    except HTTPError as e:
        fatal(e.message)
Пример #2
0
def _up(box, make):
    click.echo('\nStarting box %s\n' %
               style(box.name(), bold=True))

    if not box.is_running():
        start_box(box)
    else:
        box.vagrant('provision')

    if make:
        click.echo('\nRunning make %s in your box\n' %
                   style(make, bold=True))
        if box.ssh_shell('make %s' % make) != 0:
            fatal('make command failed!')

        if sync(box, 'down') is False:
            # sync failed, message should already be displayed, exit
            sys.exit(1)
Пример #3
0
def cli(up, make_cmd, box_name, project_name):
    """
    Allows you to fetch a project from GitHub
    """
    _check_github_config()

    if not project_name:
        project = from_cwd()
        if not project:
            fatal("""You are not in a project directory.
You need to specify what project you want to fetch.""")
        project_name = project.name()
    else:
        project = get(project_name)

    if not project:
        _clone_project(project_name)
    else:
        _update_project(project)

    # reload project if created
    project = get(project_name)

    # move the user in the project directory
    move_shell_to(project.folder())

    if not project.initialized():
        warning('warning: this is not an aeriscloud project, aborting...')
        sys.exit(1)

    # make_cmd implies up
    if make_cmd:
        up = True

    box = project.box(box_name)
    if up:
        info('AerisCloud will now start your box and provision it, '
             'this op might take a while.')
        start_box(box)

        if make_cmd:
            print(make_cmd)
            box.ssh_shell('make %s' % make_cmd)