コード例 #1
0
def validate(project_path, autocorrect):
    """Validates an Assembly/Resource project"""
    logger.debug('Validating project at: {0}'.format(project_path))
    project = lifecycle_cli.open_project(project_path)
    controller = lifecycle_cli.ExecutionController(VALIDATE_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    exec_validate(controller, project, allow_autocorrect=autocorrect)
    controller.finalise()
コード例 #2
0
def build(project_path, autocorrect):
    """Builds an Assembly/Resource project"""
    logger.debug('Building project at: {0}'.format(project_path))
    project = lifecycle_cli.open_project(project_path)
    controller = lifecycle_cli.ExecutionController(BUILD_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    exec_build(controller, project, allow_autocorrect=autocorrect)
    controller.finalise()
コード例 #3
0
def pull(project_path, environment, config, pwd):
    """Pulls the content of a Assembly/Resource from a target CP4NA orchestration environment, overidding local content"""
    logger.debug('Pulling project at: {0}'.format(project_path))
    project = lifecycle_cli.open_project(project_path)
    env_sessions = lifecycle_cli.build_sessions_for_project(
        project.config, environment, pwd, None, config)
    controller = lifecycle_cli.ExecutionController(PULL_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    exec_pull(controller, project, env_sessions)
    controller.finalise()
コード例 #4
0
def list(project_path, element):
    logger.debug('Pulling elements of type {0} on project at: {1}'.format(
        element, project_path))
    project = lifecycle_cli.open_project(project_path)
    controller = lifecycle_cli.ExecutionController(LIST_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    elements = controller.execute(project.list_elements, element)
    if len(elements) == 0:
        lifecycle_cli.printer.print_text('No tests')
    for element in elements:
        lifecycle_cli.printer.print_text('- {0}'.format(element))
    controller.finalise()
コード例 #5
0
def push(project_path, environment, config, armname, pwd, autocorrect):
    """Push an Assembly/Resource project"""
    logger.debug('Pushing project at: {0}'.format(project_path))
    project = lifecycle_cli.open_project(project_path)
    env_sessions = lifecycle_cli.build_sessions_for_project(
        project.config, environment, pwd, armname, config)
    controller = lifecycle_cli.ExecutionController(PUSH_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    build_result = exec_build(controller,
                              project,
                              allow_autocorrect=autocorrect)
    exec_push(controller, build_result.pkg, env_sessions)
    controller.finalise()
コード例 #6
0
ファイル: project.py プロジェクト: rajahaidar/lmctl
def test(project_path, environment, config, armname, tests, pwd, autocorrect):
    """Builds, pushes and runs the tests of an Assembly/Resource project on a target LM (and ARM) environment"""
    logger.debug('Testing project at: {0}'.format(project_path))
    project = lifecycle_cli.open_project(project_path)
    env_sessions = lifecycle_cli.build_sessions_for_project(
        project.config, environment, pwd, armname, config)
    controller = lifecycle_cli.ExecutionController(TEST_HEADER)
    controller.start('{0} at {1}'.format(project.config.name, project_path))
    build_result = exec_build(controller,
                              project,
                              allow_autocorrect=autocorrect)
    pkg_content = exec_push(controller, build_result.pkg, env_sessions)
    exec_test(controller, pkg_content, env_sessions)
    controller.finalise()