zuul-jobs/roles/fetch-sphinx-tarball/tasks/main.yaml
Andreas Jaeger 601711dfa3 Handle sphinx PDF files
This enhances fetch-sphinx-tarball to fetch PDF files as well if
they are published

For now, it collects a single PDF file since sphinx only generates one.
The name of the PDF file is not known in advance.

The publishing is done with https://review.opendev.org/678142.
This will then be used by https://review.opendev.org/664555.

Change-Id: I872ab1f696495dc40cb845e0eee5f6f0ffe892d8
2019-08-23 08:30:05 +02:00

20 lines
534 B
YAML

- name: Inspect sphinx build directory
find:
file_type: any
paths: "{{ zuul_work_dir }}/{{ sphinx_build_dir }}"
register: sphinx_dir
- name: Parse sphinx build directory
set_fact:
sphinx_dir: "{{ sphinx_dir.files | map(attribute='path') | map('regex_replace', '^.*/(.*)$', '\\1') | list }}"
- name: Process sphinx HTML
when: "'html' in sphinx_dir"
include_tasks: html.yaml
- name: Process sphinx PDF
when: "'pdf' in sphinx_dir"
include_tasks: pdf.yaml
# Other sphinx output processing can be added here.