Commit 145e14b5 authored by Protocole's avatar Protocole
Browse files

Merge branch '319-fix-job_structure' into 'latest'

Resolve "Fix job_structure"

Closes #319

See merge request r2devops/hub!166
parents 85b82acc 932d35c9
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -344,11 +344,6 @@ def create_job_doc(job):
        sys.exit(1)

def add_placeholder():
<<<<<<< HEAD
    # Verify that there is a .md file for every stage, or mkdocs will break
    for stage_key, _ in utils.INDEX.items():
        placeholder_path = utils.MKDOCS_DIR + "/" + utils.JOBS_DIR + "/" + stage_key
=======
    """Add a placeholder file for every stage, in case a stage have no job

    Parameters:
@@ -359,9 +354,8 @@ def add_placeholder():
    -------
    nothing
    """
    for stage_key, _ in index.items():
        placeholder_path = MKDOCS_DIR + "/" + JOBS_DIR + "/" + stage_key
>>>>>>> c767458a64a4ec118dbce0fad6bb909f39eb4ef6
    for stage_key, _ in utils.INDEX.items():
        placeholder_path = utils.MKDOCS_DIR + "/" + utils.JOBS_DIR + "/" + stage_key
        if len(listdir(placeholder_path)) == 1:
            # There is only the .pages file, so mkdocs will break
            with open(placeholder_path + "/" + utils.MKDOCS_PLACEHOLDER_FILE, "w+") as file_handle:
+5 −5
Original line number Diff line number Diff line
@@ -24,16 +24,16 @@ def get_conf(job_path):
        (dict): Object of parsed YAML
    """
    try:
        with open(job_path + "/" + JOB_YAML) as conf_file:
        with open(job_path + "/" + utils.JOB_YAML) as conf_file:
            return full_load(conf_file)
    except YAMLError as error:
        logging.error("Failed to parse job config '%s/%s", job_path,
                      JOB_YAML )
                      utils.JOB_YAML )
        logging.error(error)
        sys.exit(1)
    except OSError as error:
        logging.error("Failed to open and read job config '%s/%s",
                      job_path, JOB_YAML )
                      job_path, utils.JOB_YAML )
        logging.error(error)
        sys.exit(1)

@@ -49,9 +49,9 @@ def check_job_labels(job):
    --------
    """

    ret = EXIT_SUCCESS
    ret = utils.EXIT_SUCCESS
    # Getting conf for indexing
    conf = get_conf(JOBS_DIR+"/"+job)
    conf = get_conf(utils.JOBS_DIR+"/"+job)
    job_labels = conf.get("labels")