Commit d95982a3 authored by Thomas Boni's avatar Thomas Boni
Browse files

Merge branch...

Merge branch '67-semver-versioned-jobs-documentation-doesn-t-show-properly-in-retractable-window' into 'latest'

Resolve "Semver versioned jobs documentation doesn't show properly in retractable window"

Closes #67

See merge request go2scale/hub!26
parents 70c8cf88 52af857e
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)
+13 −11
Original line number Diff line number Diff line
{{ readme }}

??? License
{% for line in license %}
  {% if line %}
{%- for line in license -%}
  {%- if line %}
    {{ line }}
  {% endif %}
{% endfor %}
  {%- endif -%}
{%- endfor %}

# Changelog

* **[latest]({{ latest.url }})** (current -> `{{ latest.version }}`): `{{ latest.url }}`
{% for version in changelogs %}
??? {{ version.version }}

{% for version in changelogs -%}
??? "{{ version.version }}"
    `{{ version.url }}`
  {% for line in version.changelog %}
    {% if line %}
    {%- if line %}
    {{ line }}
    {% endif %}
  {% endfor %}
    {%- endif %}
  {%- endfor %}
{% endfor %}

{% if code_owner %}
{%- if code_owner %}
-- 🔨 Maintainer: <img src='{{ gitlab_image }}' alt='avatar' style='width: 20px; height: 20px; border-radius: 50%'> [{{ code_owner_name }}]({{ code_owner_url }}) @{{ code_owner }}
{% endif %}
 No newline at end of file
{%- endif %}