Make AFS marker roles honor sphinx variables

We set a sphinx_build_dir already on jobs. Make write-root-marker,
prepare-docs-for-afs and prepare-infra-docs-for-afs honor it by default.

Change-Id: I7c3d578a00a4aa4c9e175f5f83e3171c6f6a4a61
This commit is contained in:
Monty Taylor 2017-12-05 12:52:41 -06:00 committed by Andreas Jaeger
parent f6d816991f
commit 35a773a863
8 changed files with 36 additions and 8 deletions

View File

@ -1,5 +1,10 @@
Prepare built OpenStack docs to be published to the OpenStack AFS cell.
.. zuul:rolevar:: sphinx_build_dir
:default: doc/build
Directory relative to zuul_work_dir where Sphinx build output was put.
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
@ -10,4 +15,3 @@ Prepare built OpenStack docs to be published to the OpenStack AFS cell.
Directory where the documentation lives, the build documentation is
in a sub directory called build, by default doc/build.

View File

@ -1,2 +1,3 @@
zuul_work_dir: "src/{{ zuul.project.canonical_name }}"
doc_toplevel_dir: "doc"
sphinx_build_dir: "{{ doc_toplevel_dir }}/build"
zuul_work_dir: "{{ zuul.project.src_dir }}"

View File

@ -1,6 +1,6 @@
- name: Set build directory
set_fact:
doc_build_dir: "{{ zuul_work_dir }}/{{doc_toplevel_dir}}/build"
doc_build_dir: "{{ zuul_work_dir }}/{{ sphinx_build_dir }}"
- name: Write marker text
copy:
@ -25,7 +25,7 @@
executable: /bin/bash
shell: |
set -xe
DOCBUILD="{{ doc_toplevel_dir }}/build"
DOCBUILD="{{ sphinx_build_dir }}"
if [[ {{ zuul.ref }} =~ ^refs/tags/ ]]; then
# This job should not be configured to run for
# pre-releases, so if we have a tag we want to use it as

View File

@ -1 +1,11 @@
Prepare built openstack-infra docs to be published to the OpenStack AFS cell.
.. zuul:rolevar:: sphinx_build_dir
:default: doc/build
Directory relative to zuul_work_dir where Sphinx build output was put.
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Directory to build documentation in.

View File

@ -1 +1,2 @@
zuul_work_dir: "src/{{ zuul.project.canonical_name }}"
sphinx_build_dir: doc/build
zuul_work_dir: "{{ zuul.project.src_dir }}"

View File

@ -1,6 +1,6 @@
- name: Set build dir fact
set_fact:
doc_build_dir: "{{ zuul_work_dir }}/doc/build"
doc_build_dir: "{{ zuul_work_dir }}/{{ sphinx_doc_build }}"
- name: Write marker text
copy:

View File

@ -2,8 +2,18 @@ Write the root marker for an AFS publishing job
** Role Variables **
.. zuul:rolevar:: sphinx_build_dir
:default: doc/build
Directory relative to zuul_work_dir where Sphinx build output was put.
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Directory to operate in.
.. zuul:rolevar:: root_marker_dir
:default: src/{{ zuul.project.canonical_name }}/doc/build/html
:default: {{ zuul_work_dir }}/{{ sphinx_build_dir }}/html
The documentation build directory. The marker file will be placed
in this directory.

View File

@ -1 +1,3 @@
root_marker_dir: "src/{{ zuul.project.canonical_name }}/doc/build/html"
sphinx_build_dir: "doc/build"
zuul_work_dir: "{{ zuul.project.src_dir }}"
root_marker_dir: "{{ zuul_work_dir }}/{{ sphinx_build_dir }}/html"