From d8c70508267bbb5d3993de4504ac203bbb6d5f4a Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 17 Nov 2017 14:08:58 -0600 Subject: [PATCH] Use the new sphinx PTI for special publish jobs Both releasenotes and docs build jobs have updated PTI job content. As a step to rolling it out, update the direct and infra jobs to use the new direct sphinx method. Also add -python3 versions of the jobs for the projects that need python3. The publish-openstack-sphinx-docs job still uses tox. The next patch will update it as well. Change-Id: I2d0222225f4ae6c45d09f9352c256062e2535d63 Depends-On: Idd7caf7d88b56d61872906027b4ce7d743572ded --- playbooks/project-config/post-tox.yaml | 3 + .../pre.yaml => project-config/pre-tox.yaml} | 2 +- playbooks/python-docs/run.yaml | 5 - .../{python-docs => sphinx}/post-direct.yaml | 1 - .../{python-docs => sphinx}/post-infra.yaml | 1 - playbooks/{python-docs => sphinx}/post.yaml | 1 - playbooks/sphinx/pre.yaml | 7 + playbooks/sphinx/run.yaml | 4 + zuul.d/jobs.yaml | 155 ++++++++++++++---- zuul.d/projects.yaml | 2 +- 10 files changed, 136 insertions(+), 45 deletions(-) create mode 100644 playbooks/project-config/post-tox.yaml rename playbooks/{python-docs/pre.yaml => project-config/pre-tox.yaml} (63%) delete mode 100644 playbooks/python-docs/run.yaml rename playbooks/{python-docs => sphinx}/post-direct.yaml (94%) rename playbooks/{python-docs => sphinx}/post-infra.yaml (91%) rename playbooks/{python-docs => sphinx}/post.yaml (90%) create mode 100644 playbooks/sphinx/pre.yaml create mode 100644 playbooks/sphinx/run.yaml diff --git a/playbooks/project-config/post-tox.yaml b/playbooks/project-config/post-tox.yaml new file mode 100644 index 0000000000..e9eeeca48c --- /dev/null +++ b/playbooks/project-config/post-tox.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - fetch-tox-output diff --git a/playbooks/python-docs/pre.yaml b/playbooks/project-config/pre-tox.yaml similarity index 63% rename from playbooks/python-docs/pre.yaml rename to playbooks/project-config/pre-tox.yaml index ded21cd6f7..b2b8b1106c 100644 --- a/playbooks/python-docs/pre.yaml +++ b/playbooks/project-config/pre-tox.yaml @@ -2,6 +2,6 @@ roles: - role: bindep bindep_profile: test - bindep_dir: "src/{{ zuul.project.canonical_name }}" + bindep_dir: "{{ zuul_work_dir|default(omit) }}" - ensure-tox - revoke-sudo diff --git a/playbooks/python-docs/run.yaml b/playbooks/python-docs/run.yaml deleted file mode 100644 index 0bf50adc3e..0000000000 --- a/playbooks/python-docs/run.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- hosts: all - roles: - - role: tox - tox_envlist: venv - tox_extra_args: -vv python setup.py build_sphinx diff --git a/playbooks/python-docs/post-direct.yaml b/playbooks/sphinx/post-direct.yaml similarity index 94% rename from playbooks/python-docs/post-direct.yaml rename to playbooks/sphinx/post-direct.yaml index f48fb57154..b51ea3ccb4 100644 --- a/playbooks/python-docs/post-direct.yaml +++ b/playbooks/sphinx/post-direct.yaml @@ -1,6 +1,5 @@ - hosts: all roles: - - fetch-tox-output - role: write-root-marker root_marker_dir: "src/{{ zuul.project.canonical_name }}/doc/build/html" when: zuul_success | bool diff --git a/playbooks/python-docs/post-infra.yaml b/playbooks/sphinx/post-infra.yaml similarity index 91% rename from playbooks/python-docs/post-infra.yaml rename to playbooks/sphinx/post-infra.yaml index 1f6a331e5b..d21e683379 100644 --- a/playbooks/python-docs/post-infra.yaml +++ b/playbooks/sphinx/post-infra.yaml @@ -1,7 +1,6 @@ - hosts: all roles: - prepare-infra-docs-for-afs - - fetch-tox-output - role: fetch-sphinx-output sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/" zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" diff --git a/playbooks/python-docs/post.yaml b/playbooks/sphinx/post.yaml similarity index 90% rename from playbooks/python-docs/post.yaml rename to playbooks/sphinx/post.yaml index 0881f9f110..71fe3705fa 100644 --- a/playbooks/python-docs/post.yaml +++ b/playbooks/sphinx/post.yaml @@ -1,7 +1,6 @@ - hosts: all roles: - prepare-docs-for-afs - - fetch-tox-output - role: fetch-sphinx-output sphinx_output_src: "src/{{ zuul.project.canonical_name }}/doc/build/html/" zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" diff --git a/playbooks/sphinx/pre.yaml b/playbooks/sphinx/pre.yaml new file mode 100644 index 0000000000..272527b239 --- /dev/null +++ b/playbooks/sphinx/pre.yaml @@ -0,0 +1,7 @@ +- hosts: all + roles: + - role: bindep + bindep_profile: doc + bindep_dir: "{{ zuul_work_dir|default(omit) }}" + - ensure-sphinx + - revoke-sudo diff --git a/playbooks/sphinx/run.yaml b/playbooks/sphinx/run.yaml new file mode 100644 index 0000000000..f831207dee --- /dev/null +++ b/playbooks/sphinx/run.yaml @@ -0,0 +1,4 @@ +- hosts: all + roles: + - install-if-python + - sphinx diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 17ac017038..b6e04a9696 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -196,10 +196,11 @@ Publishes depending on branch to latest/ (for master), or the basename of the branch like pike (for stable/pike). final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/project-config/pre-tox.yaml + run: playbooks/project-config/run-tox.yaml post-run: - - playbooks/python-docs/post.yaml + - playbooks/project-config/post-tox.yaml + - playbooks/sphinx/post.yaml - playbooks/publish/openstack-afs.yaml required-projects: - name: openstack/requirements @@ -208,6 +209,36 @@ - zuul: openstack-infra/openstack-zuul-jobs vars: tox_constraints_file: '{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt' + tox_envlist: venv + tox_extra_args: -vv python setup.py build_sphinx + secrets: + - secret: afsdocs_secret + name: afs + +- job: + name: publish-openstack-sphinx-docs-python3 + description: | + Publish the results of the build-openstack-sphinx-docs job to + /afs/.openstack.org/docs/{{ zuul.project.short_name }}. + + Builds the docs using Sphinx with Python3. + + Publishes depending on branch to latest/ (for master), or the + basename of the branch like pike (for stable/pike). + final: true + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml + post-run: + - playbooks/sphinx/post.yaml + - playbooks/publish/openstack-afs.yaml + required-projects: + - name: openstack/requirements + roles: + - zuul: openstack-infra/zuul-jobs + - zuul: openstack-infra/openstack-zuul-jobs + vars: + tox_constraints_file: '{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt' + sphinx_python: python3 secrets: - secret: afsdocs_secret name: afs @@ -220,10 +251,10 @@ Publishing is done from master branch directly without using /latest. final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml post-run: - - playbooks/python-docs/post-direct.yaml + - playbooks/sphinx/post-direct.yaml - playbooks/publish/openstack-afs.yaml required-projects: - name: openstack/requirements @@ -238,14 +269,43 @@ - secret: afsdocs_secret name: afs +- job: + name: publish-openstack-sphinx-docs-direct-python3 + description: | + Publish the results of the build-openstack-sphinx-docs job to + /afs/.openstack.org/docs/{{ zuul.project.short_name }} + + Builds the docs using Sphinx with Python3. + + Publishing is done from master branch directly without using /latest. + final: true + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml + post-run: + - playbooks/sphinx/post-direct.yaml + - playbooks/publish/openstack-afs.yaml + required-projects: + - name: openstack/requirements + roles: + - zuul: openstack-infra/zuul-jobs + - zuul: openstack-infra/openstack-zuul-jobs + vars: + tox_constraints_file: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt" + sphinx_python: python3 + branches: + - master + secrets: + - secret: afsdocs_secret + name: afs + - job: name: publish-openstack-contributor-guide description: | Publish contributor-guide documents to https://docs.openstack.org/contributors final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml post-run: playbooks/publish/contributor-guide-afs.yaml roles: - zuul: openstack-infra/zuul-jobs @@ -256,19 +316,23 @@ name: afs - job: - name: publish-openstack-sphinx-tox-docs + name: publish-openstack-sphinx-i18n description: | + Special publication job for the openstack/i18n project. + Publish the results of the build-openstack-sphinx-docs job to /afs/.openstack.org/docs/{{ zuul.project.short_name }}. Publishes depending on branch to latest/ (for master), or the basename of the branch like pike (for stable/pike). - This uses the tox "docs" environment for publishing. final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml + allowed-projects: + - openstack/i18n post-run: - - playbooks/python-docs/post.yaml + - playbooks/project-config/post-tox.yaml + - playbooks/sphinx/post.yaml - playbooks/publish/openstack-afs.yaml required-projects: - name: openstack/requirements @@ -296,7 +360,6 @@ - name: openstack/requirements roles: - zuul: openstack-infra/zuul-jobs - - zuul: openstack-infra/openstack-zuul-jobs vars: constraints_file: '{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt' secrets: @@ -309,8 +372,8 @@ Publish OpenStack specs to static.openstack.org specs/{{ zuul.project.short_name }} final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml post-run: playbooks/publish/openstack-specs.yaml required-projects: - name: openstack/requirements @@ -327,7 +390,7 @@ description: | Publish OpenStack specs site to static.openstack.org specs/ final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/openstack-specs-site.yaml allowed-projects: @@ -346,10 +409,10 @@ Publish the results of the openstack-build-sphinx-docs job to /afs/.openstack.org/infra/{{ zuul.project.short_name }} final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml post-run: - - playbooks/python-docs/post-infra.yaml + - playbooks/sphinx/post-infra.yaml - playbooks/publish/infra-afs.yaml roles: - zuul: openstack-infra/zuul-jobs @@ -358,15 +421,37 @@ - secret: afsdocs_secret name: afs +- job: + name: publish-openstack-sphinx-docs-infra-python3 + description: | + Publish the results of the openstack-build-sphinx-docs job to + /afs/.openstack.org/infra/{{ zuul.project.short_name }} + + Builds the docs using Sphinx with Python3. + final: true + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml + post-run: + - playbooks/sphinx/post-infra.yaml + - playbooks/publish/infra-afs.yaml + vars: + sphinx_python: python3 + roles: + - zuul: openstack-infra/zuul-jobs + - zuul: openstack-infra/openstack-zuul-jobs + secrets: + - secret: afsdocs_secret + name: afs + - job: name: publish-infra-manual description: | Publish the Infra Manual to /afs/.openstack.org/docs/infra/manual final: true - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml post-run: - - playbooks/python-docs/post-infra.yaml + - playbooks/sphinx/post-infra.yaml - playbooks/publish/infra-manual.yaml allowed-projects: - openstack-infra/infra-manual @@ -383,7 +468,7 @@ Publish OpenStack Service Types Authority to https://service-types.openstack.org final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/service-types.yaml allowed-projects: @@ -401,7 +486,7 @@ description: | Publish the infrastructure documentation index final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/infra-index.yaml allowed-projects: @@ -420,7 +505,7 @@ description: | Publish the publication index final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/publications-index/run.yaml post-run: playbooks/publish/publications-index.yaml allowed-projects: @@ -439,7 +524,7 @@ description: | Publish one publication from openstack-infra/publications final: true - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/publications/run.yaml post-run: playbooks/publish/publications.yaml allowed-projects: @@ -486,9 +571,9 @@ - job: name: base-publish-static description: | - Base job for job that publish content to static.openstack.org. - pre-run: playbooks/python-docs/pre.yaml - run: playbooks/python-docs/run.yaml + Base job for jobs that publish content to static.openstack.org. + pre-run: playbooks/sphinx/pre.yaml + run: playbooks/sphinx/run.yaml - job: name: publish-static @@ -572,7 +657,7 @@ Note that this build job does not create a root-marker file, this has to be done by scripts called from tox. - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml roles: - zuul: openstack-infra/zuul-jobs @@ -643,7 +728,7 @@ description: | Publish api-guide document to https://developer.openstack.org/api-guide. - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/api-guide.yaml roles: @@ -663,7 +748,7 @@ description: | Publish api-ref document to https://developer.openstack.org/api-ref. - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/api-ref.yaml roles: @@ -683,7 +768,7 @@ description: | Publish placement-api-ref document to https://developer.openstack.org/api-ref/placement. - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/placement-api-ref.yaml roles: @@ -703,7 +788,7 @@ description: | Publish install-guide document to https://docs.openstack.org/project-install-guide/ - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/install-guide.yaml roles: @@ -724,7 +809,7 @@ description: | Publish deploy-guide document to https://docs.openstack.org/project-deploy-guide/ - pre-run: playbooks/python-docs/pre.yaml + pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml post-run: playbooks/publish/deploy-guide.yaml roles: diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 699e8fcfea..c5a0346145 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -7072,7 +7072,7 @@ - openstack-tox-pep8 post: jobs: - - publish-openstack-sphinx-tox-docs + - publish-openstack-sphinx-i18n - project: name: openstack/i18n-specs