예제 #1
0
def check_swift_package_deps():
    for package in config("packages"):
        pkg, branch, url = package

        if not exists("work/%s" % pkg):
            log_error("Cannot locate %s." % pkg)
            abort(red("Please run 'fab swift_deps' first."))
예제 #2
0
def load_profile(profile_name):
    profile = json.load(open("profiles/%s" % profile_name))

    if 'platform' not in profile:
        log_error('Profile %s does not include a platform key, skipping' %
                  profile_name)
        return None

    return profile
예제 #3
0
def swift_deps():
    for package in config("packages"):
        pkg, branch, url = package

        if not exists("work/%s" % pkg):
            if url.find('git') >= 0:
                local("cd work && git clone %s" % url)
                local("cd work/%s && git checkout %s" % (pkg, branch))
            elif url.find('bitbucket') >= 0:
                local("cd work && hg clone %s" % url)
                local("cd work/%s && hg checkout %s" % (pkg, branch))
            else:
                log_error("Unknown repository server for %s" % pkg)
예제 #4
0
def platform_init():
    global PlatformManager
    global platform

    namespace, class_name = config('platform')
    try:
        log_info('Loading %s in %s' % (class_name, namespace))
        PlatformManager = platforms.load_manager(namespace, class_name)
    except Exception as e:
        log_error('Cannot load %s from %s: %s' % (class_name, namespace, e))
        sys.exit(1)

    helpers = {'log_success': log_success,
               'log_info': log_info,
               'log_warn': log_warn,
               'log_error': log_error,
               'execute_handler': execute_task_name,
               'run_handler': run,
               'host_broker_handler': host_broker_handler,
               'rexists': rexists}
    platform = PlatformManager(config('platform_options'), **helpers)