zuul-jobs/roles/fetch-sphinx-tarball/tasks/main.yaml
Tristan Cacqueray 6ac719ba2f fetch-sphinx-tarball: add missing zuul_success default
This change prevents an issue in test-jobs where zuul_success is undefined.

Change-Id: I408e9f957ff3151d39f7b5b2ea038255570baf4d
2020-05-12 16:54:32 +00:00

30 lines
764 B
YAML

- name: Inspect sphinx build directory
find:
file_type: any
follow: true
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.
# Finally fail, if no html exists
- name: Fail if no HTML exists
fail:
msg: 'No html output in "{{ sphinx_build_dir }}".'
when:
- zuul_success | default(true) | bool
- "'html' not in sphinx_dir"