def generateConfigForBranch(source_branch, url_prefix, local_branch):
    # Get main.yml from c.rh.c Prod if we can
    if source_branch == local_branch:
        config = util.getYMLFromFile("../main.yml")
    elif source_branch.startswith("prod"):
        config = util.getYMLFromUrl("https://cloud.redhat.com{}/config/main.yml".format(url_prefix))
    else:
        # Otherwise, get it from github; Jenkins can't talk to our pre-prod envs.
        config = util.getYMLFromUrl("https://raw.githubusercontent.com/RedHatInsights/cloud-services-config/{}/main.yml".format(source_branch))

    # For every app in config, check all other apps to see if they have a frontend_path that contains its frontend_paths.
    for key in (x for x in config.keys() if "frontend" in config[x] and "paths" in config[x]["frontend"]):
        exclusions = []
        for fe_path in config[key]["frontend"]["paths"]:
            exclusions.extend(generateExclusions(fe_path, config))
        config[key]["frontend_exclude"] = exclusions
    return config
Пример #2
0
def generateConfigForBranch(branch):
    config = util.getYMLFromUrl("https://raw.githubusercontent.com/RedHatInsights/cloud-services-config/master/main.yml".format(branch))
    # For every app in config, check all other apps to see if they have a frontend_path that contains its frontend_paths.
    for key in (x for x in config.keys() if "frontend" in config[x] and "paths" in config[x]["frontend"]):
        exclusions = []
        for fe_path in config[key]["frontend"]["paths"]:
            exclusions.extend(generateExclusions(fe_path, config))
        config[key]["frontend_exclude"] = exclusions
    
    return config
Пример #3
0
def generateConfigForBranch(prefix):
    config = util.getYMLFromUrl("https://cloud.redhat.com{}/config/main.yml".format(prefix))
    # For every app in config, check all other apps to see if they have a frontend_path that contains its frontend_paths.
    for key in (x for x in config.keys() if "frontend" in config[x] and "paths" in config[x]["frontend"]):
        exclusions = []
        for fe_path in config[key]["frontend"]["paths"]:
            exclusions.extend(generateExclusions(fe_path, config))
        config[key]["frontend_exclude"] = exclusions
    
    return config