Beispiel #1
0
def get_conf():
    project_root_dir, conf_file, conf, cached = discover_config_file()

    if cached is True:
        return conf

    conf = schema_migration_0(conf)

    conf_file = crawl_up_tree(conf_file, 2)
    conf.paths.projectroot = os.path.abspath(os.path.join(os.path.dirname(conf_file), '..'))
    conf.system.conf_file = conf_file

    if os.path.exists('/etc/arch-release'):
        conf.system.python = 'python2'
    else:
        conf.system.python = 'python'

    conf.system.processed = AttributeDict()
    conf.system.processed.paths = False
    conf.system.processed.edition = False
    conf.system.processed.project_paths = False
    conf.system.processed.project_conf = False
    conf.system.processed.versions = False

    conf = mangle_configuration(conf)
    conf = render_versions(conf)

    conf.git.branches.current = get_branch()
    conf.git.commit = get_commit()
    conf.project.basepath = get_manual_path(conf)

    conf = render_paths(conf)
    conf = mangle_paths(conf)

    conf.system.dependency_cache = os.path.join(conf.paths.projectroot,
                                                conf.paths.branch_output,
                                                'dependencies.json')


    conf_cache_dir = os.path.join(conf.paths.projectroot, conf.paths.branch_output)
    conf_cache = os.path.join(conf_cache_dir, 'conf-cache.json')

    if not os.path.exists(conf_cache_dir):
        os.makedirs(conf_cache_dir)

    with open(conf_cache, 'w') as f:
        json.dump(conf, f)

    return conf
Beispiel #2
0
def get_conf():
    project_root_dir, conf_file, conf = discover_config_file()

    conf = schema_migration_0(conf)

    conf_file = crawl_up_tree(conf_file, 2)
    conf.paths.projectroot = os.path.abspath(
        os.path.join(os.path.dirname(conf_file), '..'))
    conf.system.conf_file = conf_file

    if os.path.exists('/etc/arch-release'):
        conf.system.python = 'python2'
    else:
        conf.system.python = 'python'

    conf.system.processed = AttributeDict()
    conf.system.processed.paths = False
    conf.system.processed.bootstrap = False
    conf.system.processed.edition = False
    conf.system.processed.project_paths = False
    conf.system.processed.project_conf = False
    conf.system.processed.versions = False
    conf.system.processed.assets = False
    conf.system.processed.language = False
    conf.system.processed.git_info = False
    conf.system.processed.cached = False

    conf_artifact_project = os.path.realpath(
        os.path.join(conf.paths.buildsystem, 'config')).split(os.path.sep)[-2]

    if not conf.paths.projectroot.endswith(conf_artifact_project):
        return safe_bootstrap(conf)

    # order matters here:
    conf = mangle_configuration(conf)
    conf = render_git_info(conf)
    conf = render_versions(conf)
    conf = render_assets(conf)

    conf = render_paths(conf)
    conf = mangle_paths(conf)
    conf = render_cache(conf)
    conf = render_deploy_info(conf)

    return conf
Beispiel #3
0
def get_conf():
    project_root_dir, conf_file, conf = discover_config_file()

    conf = schema_migration_0(conf)

    conf_file = crawl_up_tree(conf_file, 2)
    conf.paths.projectroot = os.path.abspath(os.path.join(os.path.dirname(conf_file), '..'))
    conf.system.conf_file = conf_file

    if os.path.exists('/etc/arch-release'):
        conf.system.python = 'python2'
    else:
        conf.system.python = 'python'

    conf.system.processed = AttributeDict()
    conf.system.processed.paths = False
    conf.system.processed.bootstrap = False
    conf.system.processed.edition = False
    conf.system.processed.project_paths = False
    conf.system.processed.project_conf = False
    conf.system.processed.versions = False
    conf.system.processed.assets = False
    conf.system.processed.language = False
    conf.system.processed.git_info = False
    conf.system.processed.cached = False

    conf_artifact_project = os.path.realpath(os.path.join(conf.paths.buildsystem,
                                                   'config')).split(os.path.sep)[-2]

    if not conf.paths.projectroot.endswith(conf_artifact_project):
        return safe_bootstrap(conf)

    # order matters here:
    conf = mangle_configuration(conf)
    conf = render_git_info(conf)
    conf = render_versions(conf)
    conf = render_assets(conf)

    conf = render_paths(conf)
    conf = mangle_paths(conf)
    conf = render_cache(conf)
    conf = render_deploy_info(conf)

    return conf