Sorin Sbarnea 33461bbecc Enable yamllint
Adds yamllint to the linters with a minimal configuration, some
rules are disabled to allow us to fix them in follow-ups, if
we agree on them.

Fixes invalid YAML file containing characters inside block.

Fixes few minor linting issues.

Change-Id: I936fe2c997597972d884c5fc62655d28e8aaf8c5
2020-05-04 17:47:11 +01:00

64 lines
1.6 KiB
YAML

# Sphinx might build multiple PDF files, for example for graphic files
# to include. We only want to grab the end result and not any such
# input files.
- name: Check for PDF file names
stat:
path: "{{ zuul_work_dir }}/{{ sphinx_build_dir }}/pdf/{{ zj_sphinx_pdf }}"
get_checksum: false
get_mime: false
get_md5: false
with_items: "{{ sphinx_pdf_files }}"
loop_control:
loop_var: zj_sphinx_pdf
register: pdf_file_stat
- name: Set pdf_files_found to default
set_fact:
pdf_files_found: false
- name: Check if any file found
set_fact:
pdf_files_found: true
when: zj_pdf.stat.exists
with_items: "{{ pdf_file_stat.results }}"
loop_control:
loop_var: zj_pdf
# Now loop...
- name: Grab PDF files
when: pdf_files_found
block:
- name: Create PDF directory
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/pdf"
state: directory
- name: Fetch PDF files
synchronize:
dest: "{{ zuul.executor.log_root }}/pdf/{{ zj_pdf.zj_sphinx_pdf }}"
mode: pull
src: "{{ zj_pdf.stat.path }}"
verify_host: true
with_items: "{{ pdf_file_stat.results }}"
loop_control:
loop_var: zj_pdf
when: zj_pdf.stat.exists
- name: Return PDF artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: "Docs PDF: {{ zj_pdf.zj_sphinx_pdf }}"
url: "pdf/{{ zj_pdf.zj_sphinx_pdf }}"
metadata:
type: docs_pdf
with_items: "{{ pdf_file_stat.results }}"
loop_control:
loop_var: zj_pdf
when: zj_pdf.stat.exists