Commit 52af857e authored by Thomas Boni's avatar Thomas Boni
Browse files

add job name in version

parent 2b01b385
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -57,17 +57,19 @@ def get_description(job_path):
        return readme_file.read()

def get_changelogs(job_path, job_name):

    latest = {
      "version": listdir(job_path + "/" + JOB_CHANGELOG_DIR)[0][0:-3],
      "version": job_name + '-' + listdir(job_path + "/" + JOB_CHANGELOG_DIR)[0][0:-3],
      "url": GO2SCALE_URL + job_name + ".yml"
    }

    changelogs = []
    for version in listdir(job_path + "/" + JOB_CHANGELOG_DIR):
        full_version = job_name + '-' + version[0:-3]
        with open(job_path + "/" + JOB_CHANGELOG_DIR + "/" + version) as changelog_file:
            changelogs.append({
                "version": version[0:-3],
                "url": GO2SCALE_URL + version[0:-3] + "/" + job_name + ".yml",
                "version": full_version,
                "url": GO2SCALE_URL + full_version  + "/" + job_name + ".yml",
                "changelog": changelog_file.readlines()
            })
    return (latest, changelogs)