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' if info.status != 'development'
] ]
# Find the most recently released series. # Find the currently maintained series.
RELEASED_SERIES = [ MAINTAINED_SERIES = [
name name
for name, info in sorted(SERIES_INFO.items()) for name, info in sorted(SERIES_INFO.items())
if info.status == 'maintained' if info.status == 'maintained'
][-1] ]
# Find the most recently released series.
RELEASED_SERIES = MAINTAINED_SERIES[-1]
# Find the series being developed. # Find the series being developed.
SERIES_IN_DEVELOPMENT = [ SERIES_IN_DEVELOPMENT = [
@ -469,6 +472,7 @@ def render_template(environment, project_data, regular_repos, infra_repos,
ALL_SERIES=ALL_SERIES, ALL_SERIES=ALL_SERIES,
PAST_SERIES=PAST_SERIES, PAST_SERIES=PAST_SERIES,
RELEASED_SERIES=RELEASED_SERIES, RELEASED_SERIES=RELEASED_SERIES,
MAINTAINED_SERIES=MAINTAINED_SERIES,
SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT, SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT,
TOPDIR=topdir, TOPDIR=topdir,
SCRIPTDIR=scriptdir, 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 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guidelines
# Redirect deploy guides to their branch index. # 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 # Redirect any deploy guide project directory back to the current stable index
{{ path_to_released_series('/project-deploy-guide/?$', '/deploy/') }} {{ 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 # Redirect any deploy guide project directory back to the current stable index
{{ dir_to_page('/project-deploy-guide', '/' + RELEASED_SERIES + '/deploy/') }} {{ dir_to_page('/project-deploy-guide', '/' + RELEASED_SERIES + '/deploy/') }}
# Redirect all the project deploy folders to their appropriate branch # 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/newton', '/newton/deploy/') }}
{{ dir_to_page('/project-deploy-guide/ocata', '/ocata/deploy/') }} {% for series in MAINTAINED_SERIES %}
{{ dir_to_page('/project-deploy-guide/pike', '/pike/deploy/') }} {{ dir_to_page('/project-deploy-guide/' + series, '/' + series + '/deploy/') }}
{{ dir_to_page('/project-deploy-guide/queens', '/queens/deploy/') }} {% endfor %}
{{ dir_to_page('/project-deploy-guide/rocky', '/rocky/deploy/') }}
# Ensure each project's deloy guide is reachable. # Ensure each project's deloy guide is reachable.
/project-deploy-guide/openstack-ansible/latest/ 200 /project-deploy-guide/openstack-ansible/latest/ 200
/project-deploy-guide/openstack-ansible/pike/ 200 /project-deploy-guide/openstack-ansible/pike/ 200