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()
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()
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()
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()
def push(package, environment, config, armname, pwd, autocorrect): """Pushes an existing Assembly/Resource package to a target LM (and ARM) environment""" logger.debug('Pushing package at: {0}'.format(package)) pkg = lifecycle_cli.open_pkg(package) try: env_sessions = lifecycle_cli.build_sessions_for_pkg(pkg.meta, environment, pwd, armname, config) controller = lifecycle_cli.ExecutionController(PUSH_HEADER) controller.start(package) exec_push(controller, pkg, env_sessions, allow_autocorrect=autocorrect) finally: cleanup_pkg(pkg) controller.finalise()
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()
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()