Merge "build the redirects for the project-deploy-guide dynamically"

This commit is contained in:
Zuul 2018-08-31 08:54:55 +00:00 committed by Gerrit Code Review
commit 6fb1c868fd
3 changed files with 16 additions and 8 deletions

View File

@ -70,12 +70,15 @@ PAST_SERIES = [
if info.status != 'development'
]
# Find the most recently released series.
RELEASED_SERIES = [
# Find the currently maintained series.
MAINTAINED_SERIES = [
name
for name, info in sorted(SERIES_INFO.items())
if info.status == 'maintained'
][-1]
]
# Find the most recently released series.
RELEASED_SERIES = MAINTAINED_SERIES[-1]
# Find the series being developed.
SERIES_IN_DEVELOPMENT = [
@ -469,6 +472,7 @@ def render_template(environment, project_data, regular_repos, infra_repos,
ALL_SERIES=ALL_SERIES,
PAST_SERIES=PAST_SERIES,
RELEASED_SERIES=RELEASED_SERIES,
MAINTAINED_SERIES=MAINTAINED_SERIES,
SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT,
TOPDIR=topdir,
SCRIPTDIR=scriptdir,

View File

@ -151,7 +151,11 @@ redirect 301 /doc-contrib-guide/ui-text-guidelines.html /doc-contrib-guide/ux-ui
redirect 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guidelines
# Redirect deploy guides to their branch index.
{{ dir_to_page('/project-deploy-guide/(newton|ocata|pike|queens|rocky)', '/$1/deploy/') }}
{# newton is a special case because it exists but is not maintained #}
{{ dir_to_page('/project-deploy-guide/(newton)', '/$1/deploy/') }}
{% for series in MAINTAINED_SERIES %}
{{ dir_to_page('/project-deploy-guide/(' + series + ')', '/$1/deploy/') }}
{% endfor %}
# Redirect any deploy guide project directory back to the current stable index
{{ path_to_released_series('/project-deploy-guide/?$', '/deploy/') }}

View File

@ -170,11 +170,11 @@
# Redirect any deploy guide project directory back to the current stable index
{{ dir_to_page('/project-deploy-guide', '/' + RELEASED_SERIES + '/deploy/') }}
# Redirect all the project deploy folders to their appropriate branch
{# newton is a special case because it exists but is not maintained #}
{{ dir_to_page('/project-deploy-guide/newton', '/newton/deploy/') }}
{{ dir_to_page('/project-deploy-guide/ocata', '/ocata/deploy/') }}
{{ dir_to_page('/project-deploy-guide/pike', '/pike/deploy/') }}
{{ dir_to_page('/project-deploy-guide/queens', '/queens/deploy/') }}
{{ dir_to_page('/project-deploy-guide/rocky', '/rocky/deploy/') }}
{% for series in MAINTAINED_SERIES %}
{{ dir_to_page('/project-deploy-guide/' + series, '/' + series + '/deploy/') }}
{% endfor %}
# Ensure each project's deloy guide is reachable.
/project-deploy-guide/openstack-ansible/latest/ 200
/project-deploy-guide/openstack-ansible/pike/ 200